auth+log: add log subsystem name as constant

This commit is contained in:
Oliver Gugger
2020-01-03 17:16:58 +01:00
parent 45e4bb49d5
commit a402e403bc
2 changed files with 4 additions and 2 deletions

View File

@@ -5,6 +5,8 @@ import (
"github.com/lightningnetwork/lnd/build" "github.com/lightningnetwork/lnd/build"
) )
const Subsystem = "AUTH"
// log is a logger that is initialized with no output filters. This // log is a logger that is initialized with no output filters. This
// means the package will not perform any logging by default until the caller // means the package will not perform any logging by default until the caller
// requests it. // requests it.
@@ -12,7 +14,7 @@ var log btclog.Logger
// The default amount of logging is none. // The default amount of logging is none.
func init() { func init() {
UseLogger(build.NewSubLogger("AUTH", nil)) UseLogger(build.NewSubLogger(Subsystem, nil))
} }
// DisableLog disables all library log output. Logging output is disabled // DisableLog disables all library log output. Logging output is disabled

2
log.go
View File

@@ -15,7 +15,7 @@ var (
func init() { func init() {
setSubLogger("MAIN", log, nil) setSubLogger("MAIN", log, nil)
addSubLogger("AUTH", auth.UseLogger) addSubLogger(auth.Subsystem, auth.UseLogger)
addSubLogger("PRXY", proxy.UseLogger) addSubLogger("PRXY", proxy.UseLogger)
} }