github.com/decred/dcrlnd@v0.7.6/healthcheck/log.go (about) 1 package healthcheck 2 3 import ( 4 "github.com/decred/slog" 5 ) 6 7 // Subsystem defines the logging code for this subsystem. 8 const Subsystem = "HLCK" 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 = slog.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(slog.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 slog. 24 func UseLogger(logger slog.Logger) { 25 log = logger 26 }