From 5668b335d348203d29a850477b1a9bec0b2015ec Mon Sep 17 00:00:00 2001 From: carla Date: Mon, 9 Nov 2020 14:07:45 +0200 Subject: [PATCH] chainreg: register logger --- chainreg/log.go | 5 ++++- log.go | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/chainreg/log.go b/chainreg/log.go index 94bbb5543..267079478 100644 --- a/chainreg/log.go +++ b/chainreg/log.go @@ -5,12 +5,15 @@ import ( "github.com/lightningnetwork/lnd/build" ) +// Subsystem defines the logging code for this subsystem. +const Subsystem = "CHRE" + // log is a logger that is initialized with the btclog.Disabled logger. var log btclog.Logger // The default amount of logging is none. func init() { - UseLogger(build.NewSubLogger("CHRE", nil)) + UseLogger(build.NewSubLogger(Subsystem, nil)) } // DisableLog disables all logging output. diff --git a/log.go b/log.go index 59183b7c8..e618fd7d7 100644 --- a/log.go +++ b/log.go @@ -10,6 +10,7 @@ import ( "github.com/lightningnetwork/lnd/autopilot" "github.com/lightningnetwork/lnd/build" "github.com/lightningnetwork/lnd/chainntnfs" + "github.com/lightningnetwork/lnd/chainreg" "github.com/lightningnetwork/lnd/chanbackup" "github.com/lightningnetwork/lnd/chanfitness" "github.com/lightningnetwork/lnd/channeldb" @@ -131,6 +132,7 @@ func SetupLoggers(root *build.RotatingLogWriter) { AddSubLogger(root, chanfitness.Subsystem, chanfitness.UseLogger) AddSubLogger(root, verrpc.Subsystem, verrpc.UseLogger) AddSubLogger(root, healthcheck.Subsystem, healthcheck.UseLogger) + AddSubLogger(root, chainreg.Subsystem, chainreg.UseLogger) } // AddSubLogger is a helper method to conveniently create and register the