github.com/decred/dcrlnd@v0.7.6/cluster/log.go (about) 1 package cluster 2 3 import ( 4 "github.com/decred/dcrlnd/build" 5 "github.com/decred/slog" 6 ) 7 8 // Subsystem defines the logging code for this subsystem. 9 const Subsystem = "CLUS" 10 11 // log is a logger that is initialized with the slog.Disabled logger. 12 // 13 //nolint:unused 14 var log slog.Logger 15 16 // The default amount of logging is none. 17 func init() { 18 UseLogger(build.NewSubLogger(Subsystem, nil)) 19 } 20 21 // DisableLog disables all logging output. 22 func DisableLog() { 23 UseLogger(slog.Disabled) 24 } 25 26 // UseLogger uses a specified Logger to output package logging info. 27 func UseLogger(logger slog.Logger) { 28 log = logger 29 }