File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed
Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 1+ package itest
2+
3+ import (
4+ "github.com/btcsuite/btclog"
5+ "github.com/lightningnetwork/lnd/build"
6+ )
7+
8+ const Subsystem = "ITST"
9+
10+ // log is a logger that is initialized with no output filters. This means the
11+ // package will not perform any logging by default until the caller requests it.
12+ var log btclog.Logger
13+
14+ // The default amount of logging is none.
15+ func init () {
16+ UseLogger (build .NewSubLogger (Subsystem , nil ))
17+ }
18+
19+ // UseLogger uses a specified Logger to output package logging info.
20+ // This should be used in preference to SetLogWriter if the caller is also
21+ // using btclog.
22+ func UseLogger (logger btclog.Logger ) {
23+ log = logger
24+ }
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import (
1212 "github.com/btcsuite/btcd/chaincfg"
1313 "github.com/btcsuite/btcd/chaincfg/chainhash"
1414 "github.com/btcsuite/btcd/rpcclient"
15+ "github.com/btcsuite/btclog"
1516 "github.com/go-errors/errors"
1617 "github.com/lightninglabs/aperture"
1718 "github.com/lightninglabs/lndclient"
@@ -207,7 +208,11 @@ func (h *harnessTest) setupLogging() {
207208 tap .SetupLoggers (h .logWriter , h .interceptor )
208209 aperture .SetupLoggers (h .logWriter , h .interceptor )
209210
210- h .logWriter .SetLogLevels (* logLevel )
211+ UseLogger (build .NewSubLogger (Subsystem , func (tag string ) btclog.Logger {
212+ return h .logWriter .GenSubLogger (tag , func () {})
213+ }))
214+
215+ h .logWriter .SetLogLevels ("debug" )
211216}
212217
213218func (h * harnessTest ) newLndClient (
You can’t perform that action at this time.
0 commit comments