signal/log: adds signal logger

This commit is contained in:
Conner Fromknecht 2018-06-14 20:15:47 -07:00
parent 0ae6dec4f3
commit 3aa8f7a6b9
No known key found for this signature in database
GPG Key ID: 39DE78FBE6ACB0EF

26
signal/log.go Normal file

@ -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
}