channeldb: initialize migrations logger
This commit is contained in:
parent
43449ca7a7
commit
f5191440c5
@ -3,6 +3,7 @@ package channeldb
|
|||||||
import (
|
import (
|
||||||
"github.com/btcsuite/btclog"
|
"github.com/btcsuite/btclog"
|
||||||
"github.com/lightningnetwork/lnd/build"
|
"github.com/lightningnetwork/lnd/build"
|
||||||
|
"github.com/lightningnetwork/lnd/channeldb/migration_01_to_11"
|
||||||
)
|
)
|
||||||
|
|
||||||
// log is a logger that is initialized with no output filters. This
|
// log is a logger that is initialized with no output filters. This
|
||||||
@ -25,4 +26,5 @@ func DisableLog() {
|
|||||||
// using btclog.
|
// using btclog.
|
||||||
func UseLogger(logger btclog.Logger) {
|
func UseLogger(logger btclog.Logger) {
|
||||||
log = logger
|
log = logger
|
||||||
|
migration_01_to_11.UseLogger(logger)
|
||||||
}
|
}
|
||||||
|
@ -2,27 +2,13 @@ package migration_01_to_11
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/btcsuite/btclog"
|
"github.com/btcsuite/btclog"
|
||||||
"github.com/lightningnetwork/lnd/build"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// log is a logger that is initialized with no output filters. This
|
// log is a logger that is initialized as disabled. This means the package will
|
||||||
// means the package will not perform any logging by default until the caller
|
// not perform any logging by default until a logger is set.
|
||||||
// requests it.
|
var log = btclog.Disabled
|
||||||
var log btclog.Logger
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
UseLogger(build.NewSubLogger("CHDB", nil))
|
|
||||||
}
|
|
||||||
|
|
||||||
// DisableLog disables all library log output. Logging output is disabled
|
|
||||||
// by default until UseLogger is called.
|
|
||||||
func DisableLog() {
|
|
||||||
UseLogger(btclog.Disabled)
|
|
||||||
}
|
|
||||||
|
|
||||||
// UseLogger uses a specified Logger to output package logging info.
|
// UseLogger uses a specified Logger to output package logging info.
|
||||||
// This should be used in preference to SetLogWriter if the caller is also
|
|
||||||
// using btclog.
|
|
||||||
func UseLogger(logger btclog.Logger) {
|
func UseLogger(logger btclog.Logger) {
|
||||||
log = logger
|
log = logger
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user