lnd/lnwallet/chancloser/log.go
yyforyongyu b6049ff94b
multi: add NewLogClosure in lnutils to avoid repetition
And replaces all usage of `logClosure` with `lnutils.LogClosure`.
2024-07-25 21:25:23 +08:00

26 lines
552 B
Go

package chancloser
import (
"github.com/btcsuite/btclog"
"github.com/lightningnetwork/lnd/build"
)
// chancloserLog is a logger that is initialized with the btclog.Disabled
// logger.
var chancloserLog btclog.Logger
// The default amount of logging is none.
func init() {
UseLogger(build.NewSubLogger("CHCL", nil))
}
// DisableLog disables all logging output.
func DisableLog() {
UseLogger(btclog.Disabled)
}
// UseLogger uses a specified Logger to output package logging info.
func UseLogger(logger btclog.Logger) {
chancloserLog = logger
}