Skip to content

Commit 83c024f

Browse files
committed
supplyverifier: add logging support to package
1 parent 4558634 commit 83c024f

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

universe/supplyverifier/log.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package supplyverifier
2+
3+
import (
4+
"github.com/btcsuite/btclog/v2"
5+
)
6+
7+
// Subsystem defines the logging code for this subsystem.
8+
const Subsystem = "SUPV"
9+
10+
// log is a logger that is initialized with no output filters. This
11+
// means the package will not perform any logging by default until the caller
12+
// requests it.
13+
var log = btclog.Disabled
14+
15+
// DisableLog disables all library log output. Logging output is disabled
16+
// by default until UseLogger is called.
17+
func DisableLog() {
18+
UseLogger(btclog.Disabled)
19+
}
20+
21+
// UseLogger uses a specified Logger to output package logging info.
22+
// This should be used in preference to SetLogWriter if the caller is also
23+
// using btclog.
24+
func UseLogger(logger btclog.Logger) {
25+
log = logger
26+
}

0 commit comments

Comments
 (0)