github.com/decred/dcrd/blockchain@v1.2.1/indexers/log.go (about) 1 // Copyright (c) 2016 The btcsuite developers 2 // Copyright (c) 2016-2019 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 indexers 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 // The default amount of logging is none. 14 var log = slog.Disabled 15 16 // DisableLog disables all library log output. Logging output is disabled 17 // by default until UseLogger is called. 18 // 19 // Deprecated: Use UseLogger(slog.Disabled) instead. 20 func DisableLog() { 21 log = slog.Disabled 22 } 23 24 // UseLogger uses a specified Logger to output package logging info. 25 // This should be used in preference to SetLogWriter if the caller is also 26 // using slog. 27 func UseLogger(logger slog.Logger) { 28 log = logger 29 }