log: hook up chanbackup logger

This commit is contained in:
Olaoluwa Osuntokun 2019-02-08 19:39:38 -08:00
parent 9512d7036f
commit 056decac2a
No known key found for this signature in database
GPG key ID: CE58F7F8E20FD9A2

4
log.go
View file

@ -14,6 +14,7 @@ import (
"github.com/lightningnetwork/lnd/autopilot" "github.com/lightningnetwork/lnd/autopilot"
"github.com/lightningnetwork/lnd/build" "github.com/lightningnetwork/lnd/build"
"github.com/lightningnetwork/lnd/chainntnfs" "github.com/lightningnetwork/lnd/chainntnfs"
"github.com/lightningnetwork/lnd/chanbackup"
"github.com/lightningnetwork/lnd/channeldb" "github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/channelnotifier" "github.com/lightningnetwork/lnd/channelnotifier"
"github.com/lightningnetwork/lnd/contractcourt" "github.com/lightningnetwork/lnd/contractcourt"
@ -83,6 +84,7 @@ var (
ntfrLog = build.NewSubLogger("NTFR", backendLog.Logger) ntfrLog = build.NewSubLogger("NTFR", backendLog.Logger)
irpcLog = build.NewSubLogger("IRPC", backendLog.Logger) irpcLog = build.NewSubLogger("IRPC", backendLog.Logger)
chnfLog = build.NewSubLogger("CHNF", backendLog.Logger) chnfLog = build.NewSubLogger("CHNF", backendLog.Logger)
chbuLog = build.NewSubLogger("CHBU", backendLog.Logger)
) )
// Initialize package-global logger variables. // Initialize package-global logger variables.
@ -109,6 +111,7 @@ func init() {
chainrpc.UseLogger(ntfrLog) chainrpc.UseLogger(ntfrLog)
invoicesrpc.UseLogger(irpcLog) invoicesrpc.UseLogger(irpcLog)
channelnotifier.UseLogger(chnfLog) channelnotifier.UseLogger(chnfLog)
chanbackup.UseLogger(chbuLog)
addSubLogger(routerrpc.Subsystem, routerrpc.UseLogger) addSubLogger(routerrpc.Subsystem, routerrpc.UseLogger)
} }
@ -151,6 +154,7 @@ var subsystemLoggers = map[string]btclog.Logger{
"NTFR": ntfnLog, "NTFR": ntfnLog,
"IRPC": irpcLog, "IRPC": irpcLog,
"CHNF": chnfLog, "CHNF": chnfLog,
"CHBU": chbuLog,
} }
// initLogRotator initializes the logging rotator to write logs to logFile and // initLogRotator initializes the logging rotator to write logs to logFile and