lnd: properly initialize entities of new contractcourt package

This commit is contained in:
Olaoluwa Osuntokun
2018-01-16 20:25:34 -08:00
parent bfbec1c5d3
commit 24a16b4f49
4 changed files with 104 additions and 8 deletions

4
log.go
View File

@@ -14,6 +14,7 @@ import (
"github.com/lightningnetwork/lnd/autopilot"
"github.com/lightningnetwork/lnd/chainntnfs"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/contractcourt"
"github.com/lightningnetwork/lnd/discovery"
"github.com/lightningnetwork/lnd/htlcswitch"
"github.com/lightningnetwork/lnd/lnwallet"
@@ -70,6 +71,7 @@ var (
crtrLog = backendLog.Logger("CRTR")
btcnLog = backendLog.Logger("BTCN")
atplLog = backendLog.Logger("ATPL")
cnctLog = backendLog.Logger("CNCT")
)
// Initialize package-global logger variables.
@@ -83,6 +85,7 @@ func init() {
routing.UseLogger(crtrLog)
neutrino.UseLogger(btcnLog)
autopilot.UseLogger(atplLog)
contractcourt.UseLogger(cnctLog)
}
// subsystemLoggers maps each subsystem identifier to its associated logger.
@@ -103,6 +106,7 @@ var subsystemLoggers = map[string]btclog.Logger{
"CRTR": crtrLog,
"BTCN": btcnLog,
"ATPL": atplLog,
"CNCT": cnctLog,
}
// initLogRotator initializes the logging rotator to write logs to logFile and