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