decred.org/dcrwallet/v3@v3.1.0/wallet/log.go (about) 1 // Copyright (c) 2015 The btcsuite developers 2 // Copyright (c) 2018 The Decred developers 3 // Use of this source code is governed by an ISC 4 // license that can be found in the LICENSE file. 5 6 package wallet 7 8 import "github.com/decred/slog" 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 // UseLogger uses a specified Logger to output package logging info. 16 // This should be used in preference to SetLogWriter if the caller is also 17 // using slog. 18 func UseLogger(logger slog.Logger) { 19 log = logger 20 } 21 22 type debugLogger struct{} 23 24 var debugLog debugLogger 25 26 func (debugLogger) Print(args ...interface{}) { log.Debug(args...) } 27 func (debugLogger) Printf(format string, args ...interface{}) { log.Debugf(format, args...) }