log: wire up the new WalletKit logger

This commit is contained in:
Olaoluwa Osuntokun 2018-10-24 19:32:37 -07:00
parent 14ca3bb012
commit 844698048a
No known key found for this signature in database
GPG Key ID: CE58F7F8E20FD9A2

4
log.go
View File

@ -20,6 +20,7 @@ import (
"github.com/lightningnetwork/lnd/discovery"
"github.com/lightningnetwork/lnd/htlcswitch"
"github.com/lightningnetwork/lnd/lnrpc/signrpc"
"github.com/lightningnetwork/lnd/lnrpc/walletrpc"
"github.com/lightningnetwork/lnd/lnwallet"
"github.com/lightningnetwork/lnd/routing"
"github.com/lightningnetwork/lnd/signal"
@ -67,6 +68,7 @@ var (
sphxLog = build.NewSubLogger("SPHX", backendLog.Logger)
swprLog = build.NewSubLogger("SWPR", backendLog.Logger)
sgnrLog = build.NewSubLogger("SGNR", backendLog.Logger)
wlktLog = build.NewSubLogger("WLKT", backendLog.Logger)
)
// Initialize package-global logger variables.
@ -85,6 +87,7 @@ func init() {
signal.UseLogger(ltndLog)
sweep.UseLogger(swprLog)
signrpc.UseLogger(sgnrLog)
walletrpc.UseLogger(wlktLog)
}
// subsystemLoggers maps each subsystem identifier to its associated logger.
@ -109,6 +112,7 @@ var subsystemLoggers = map[string]btclog.Logger{
"SPHX": sphxLog,
"SWPR": swprLog,
"SGNR": sgnrLog,
"WLKT": wlktLog,
}
// initLogRotator initializes the logging rotator to write logs to logFile and