log: register logger for new Signer RPC Service, namespace SGNR

This commit is contained in:
Olaoluwa Osuntokun 2018-10-22 17:42:21 -07:00
parent 8971931aa3
commit 16d16cf1b6
No known key found for this signature in database
GPG Key ID: CE58F7F8E20FD9A2

4
log.go
View File

@ -19,6 +19,7 @@ import (
"github.com/lightningnetwork/lnd/contractcourt" "github.com/lightningnetwork/lnd/contractcourt"
"github.com/lightningnetwork/lnd/discovery" "github.com/lightningnetwork/lnd/discovery"
"github.com/lightningnetwork/lnd/htlcswitch" "github.com/lightningnetwork/lnd/htlcswitch"
"github.com/lightningnetwork/lnd/lnrpc/signrpc"
"github.com/lightningnetwork/lnd/lnwallet" "github.com/lightningnetwork/lnd/lnwallet"
"github.com/lightningnetwork/lnd/routing" "github.com/lightningnetwork/lnd/routing"
"github.com/lightningnetwork/lnd/signal" "github.com/lightningnetwork/lnd/signal"
@ -65,6 +66,7 @@ var (
cnctLog = build.NewSubLogger("CNCT", backendLog.Logger) cnctLog = build.NewSubLogger("CNCT", backendLog.Logger)
sphxLog = build.NewSubLogger("SPHX", backendLog.Logger) sphxLog = build.NewSubLogger("SPHX", backendLog.Logger)
swprLog = build.NewSubLogger("SWPR", backendLog.Logger) swprLog = build.NewSubLogger("SWPR", backendLog.Logger)
sgnrLog = build.NewSubLogger("SGNR", backendLog.Logger)
) )
// Initialize package-global logger variables. // Initialize package-global logger variables.
@ -82,6 +84,7 @@ func init() {
sphinx.UseLogger(sphxLog) sphinx.UseLogger(sphxLog)
signal.UseLogger(ltndLog) signal.UseLogger(ltndLog)
sweep.UseLogger(swprLog) sweep.UseLogger(swprLog)
signrpc.UseLogger(sgnrLog)
} }
// subsystemLoggers maps each subsystem identifier to its associated logger. // subsystemLoggers maps each subsystem identifier to its associated logger.
@ -105,6 +108,7 @@ var subsystemLoggers = map[string]btclog.Logger{
"CNCT": cnctLog, "CNCT": cnctLog,
"SPHX": sphxLog, "SPHX": sphxLog,
"SWPR": swprLog, "SWPR": swprLog,
"SGNR": sgnrLog,
} }
// initLogRotator initializes the logging rotator to write logs to logFile and // initLogRotator initializes the logging rotator to write logs to logFile and