multi: init subsystem loggers via build pkg

This commit is contained in:
Conner Fromknecht
2018-09-20 03:14:50 -07:00
parent 9654a1c619
commit 59b459674d
10 changed files with 50 additions and 27 deletions

View File

@@ -1,6 +1,9 @@
package autopilot
import "github.com/btcsuite/btclog"
import (
"github.com/btcsuite/btclog"
"github.com/lightningnetwork/lnd/build"
)
// 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
@@ -9,13 +12,13 @@ var log btclog.Logger
// The default amount of logging is none.
func init() {
DisableLog()
UseLogger(build.NewSubLogger("ATPL", nil))
}
// DisableLog disables all library log output. Logging output is disabled
// by default until UseLogger is called.
func DisableLog() {
log = btclog.Disabled
UseLogger(btclog.Disabled)
}
// UseLogger uses a specified Logger to output package logging info.