From 3aa8f7a6b996ce73e34d67636116ad171fdcebdf Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Thu, 14 Jun 2018 20:15:47 -0700 Subject: [PATCH] signal/log: adds signal logger --- signal/log.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 signal/log.go diff --git a/signal/log.go b/signal/log.go new file mode 100644 index 00000000..e7034321 --- /dev/null +++ b/signal/log.go @@ -0,0 +1,26 @@ +package signal + +import "github.com/btcsuite/btclog" + +// 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 + +// The default amount of logging is none. +func init() { + DisableLog() +} + +// DisableLog disables all library log output. Logging output is disabled +// by default until UseLogger is called. +func DisableLog() { + 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 +}