Alphabetize subsystem loggers.

This commit simply alphabetizes the subsystem logger variables, map, and
use switch so the order in the code is consistent with the sorted output
displayed when using --debuglevel.
This commit is contained in:
Dave Collins 2014-03-01 12:44:39 -06:00
parent 91e563edaa
commit d2bfd3d98b

40
log.go
View file

@ -31,30 +31,30 @@ const (
// function.
var (
backendLog = seelog.Disabled
btcdLog = btclog.Disabled
bcdbLog = btclog.Disabled
chanLog = btclog.Disabled
scrpLog = btclog.Disabled
amgrLog = btclog.Disabled
bcdbLog = btclog.Disabled
bmgrLog = btclog.Disabled
btcdLog = btclog.Disabled
chanLog = btclog.Disabled
discLog = btclog.Disabled
peerLog = btclog.Disabled
rpcsLog = btclog.Disabled
scrpLog = btclog.Disabled
srvrLog = btclog.Disabled
txmpLog = btclog.Disabled
)
// subsystemLoggers maps each subsystem identifier to its associated logger.
var subsystemLoggers = map[string]btclog.Logger{
"BTCD": btcdLog,
"BCDB": bcdbLog,
"CHAN": chanLog,
"SCRP": scrpLog,
"AMGR": amgrLog,
"BCDB": bcdbLog,
"BMGR": bmgrLog,
"BTCD": btcdLog,
"CHAN": chanLog,
"DISC": discLog,
"PEER": peerLog,
"RPCS": rpcsLog,
"SCRP": scrpLog,
"SRVR": srvrLog,
"TXMP": txmpLog,
}
@ -84,27 +84,23 @@ func useLogger(subsystemID string, logger btclog.Logger) {
subsystemLoggers[subsystemID] = logger
switch subsystemID {
case "BTCD":
btcdLog = logger
case "AMGR":
amgrLog = logger
case "BCDB":
bcdbLog = logger
btcdb.UseLogger(logger)
case "BMGR":
bmgrLog = logger
case "BTCD":
btcdLog = logger
case "CHAN":
chanLog = logger
btcchain.UseLogger(logger)
case "SCRP":
scrpLog = logger
btcscript.UseLogger(logger)
case "AMGR":
amgrLog = logger
case "BMGR":
bmgrLog = logger
case "DISC":
discLog = logger
@ -114,6 +110,10 @@ func useLogger(subsystemID string, logger btclog.Logger) {
case "RPCS":
rpcsLog = logger
case "SCRP":
scrpLog = logger
btcscript.UseLogger(logger)
case "SRVR":
srvrLog = logger