log: add logger for the autopilot package

This commit is contained in:
Olaoluwa Osuntokun 2017-08-10 21:39:45 -07:00
parent 8dd4245d43
commit ba5ed9e8d2
No known key found for this signature in database
GPG Key ID: 3D0A94DB79743DF5
1 changed files with 4 additions and 0 deletions

4
log.go
View File

@ -11,6 +11,7 @@ import (
"github.com/btcsuite/btclog" "github.com/btcsuite/btclog"
"github.com/jrick/logrotate/rotator" "github.com/jrick/logrotate/rotator"
"github.com/lightninglabs/neutrino" "github.com/lightninglabs/neutrino"
"github.com/lightningnetwork/lnd/autopilot"
"github.com/lightningnetwork/lnd/chainntnfs" "github.com/lightningnetwork/lnd/chainntnfs"
"github.com/lightningnetwork/lnd/channeldb" "github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/discovery" "github.com/lightningnetwork/lnd/discovery"
@ -68,6 +69,7 @@ var (
cmgrLog = backendLog.Logger("CMGR") cmgrLog = backendLog.Logger("CMGR")
crtrLog = backendLog.Logger("CRTR") crtrLog = backendLog.Logger("CRTR")
btcnLog = backendLog.Logger("BTCN") btcnLog = backendLog.Logger("BTCN")
atplLog = backendLog.Logger("ATPL")
) )
// Initialize package-global logger variables. // Initialize package-global logger variables.
@ -80,6 +82,7 @@ func init() {
connmgr.UseLogger(cmgrLog) connmgr.UseLogger(cmgrLog)
routing.UseLogger(crtrLog) routing.UseLogger(crtrLog)
neutrino.UseLogger(btcnLog) neutrino.UseLogger(btcnLog)
autopilot.UseLogger(atplLog)
} }
// subsystemLoggers maps each subsystem identifier to its associated logger. // subsystemLoggers maps each subsystem identifier to its associated logger.
@ -99,6 +102,7 @@ var subsystemLoggers = map[string]btclog.Logger{
"CMGR": cmgrLog, "CMGR": cmgrLog,
"CRTR": crtrLog, "CRTR": crtrLog,
"BTCN": btcnLog, "BTCN": btcnLog,
"ATPL": atplLog,
} }
// initLogRotator initializes the logging rotator to write logs to logFile and // initLogRotator initializes the logging rotator to write logs to logFile and