From f5191440c5faf3078bdb77c78b9a4b17b551087f Mon Sep 17 00:00:00 2001 From: Joost Jager Date: Tue, 29 Oct 2019 12:07:59 +0100 Subject: [PATCH] channeldb: initialize migrations logger --- channeldb/log.go | 2 ++ channeldb/migration_01_to_11/log.go | 20 +++----------------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/channeldb/log.go b/channeldb/log.go index e0158d45..30ddff03 100644 --- a/channeldb/log.go +++ b/channeldb/log.go @@ -3,6 +3,7 @@ package channeldb import ( "github.com/btcsuite/btclog" "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 @@ -25,4 +26,5 @@ func DisableLog() { // using btclog. func UseLogger(logger btclog.Logger) { log = logger + migration_01_to_11.UseLogger(logger) } diff --git a/channeldb/migration_01_to_11/log.go b/channeldb/migration_01_to_11/log.go index 17958b19..b169b5af 100644 --- a/channeldb/migration_01_to_11/log.go +++ b/channeldb/migration_01_to_11/log.go @@ -2,27 +2,13 @@ package migration_01_to_11 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 -// requests it. -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) -} +// log is a logger that is initialized as disabled. This means the package will +// not perform any logging by default until a logger is set. +var log = btclog.Disabled // 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) { log = logger }