github.com/decred/dcrlnd@v0.7.6/funding/log.go (about) 1 package funding 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 = "FNDG" 10 11 // log is a logger that is initialized with the slog.Disabled logger. 12 var log slog.Logger 13 14 // The default amount of logging is none. 15 func init() { 16 UseLogger(build.NewSubLogger(Subsystem, nil)) 17 } 18 19 // DisableLog disables all logging output. 20 func DisableLog() { 21 UseLogger(slog.Disabled) 22 } 23 24 // UseLogger uses a specified Logger to output package logging info. 25 func UseLogger(logger slog.Logger) { 26 log = logger 27 }