2016-05-12 09:06:07 +00:00
|
|
|
// Copyright (c) 2016 The btcsuite developers
|
2019-03-18 15:30:31 +00:00
|
|
|
// Copyright (c) 2018-2019 The Decred developers
|
2016-05-12 09:06:07 +00:00
|
|
|
// Use of this source code is governed by an ISC
|
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
|
|
package connmgr
|
|
|
|
|
|
2018-05-23 19:18:18 +00:00
|
|
|
import "github.com/decred/slog"
|
2016-05-12 09:06:07 +00:00
|
|
|
|
|
|
|
|
// log is a logger that is initialized with no output filters. This
|
|
|
|
|
// means the package will not perform any logging by default until the caller
|
|
|
|
|
// requests it.
|
|
|
|
|
// The default amount of logging is none.
|
2019-03-17 17:05:40 +00:00
|
|
|
var log = slog.Disabled
|
2016-05-12 09:06:07 +00:00
|
|
|
|
|
|
|
|
// DisableLog disables all library log output. Logging output is disabled
|
2019-03-18 15:30:31 +00:00
|
|
|
// by default until UseLogger is called.
|
|
|
|
|
//
|
|
|
|
|
// Deprecated: Use UseLogger(slog.Disabled) instead.
|
2016-05-12 09:06:07 +00:00
|
|
|
func DisableLog() {
|
2018-05-23 19:18:18 +00:00
|
|
|
log = slog.Disabled
|
2016-05-12 09:06:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// UseLogger uses a specified Logger to output package logging info.
|
|
|
|
|
// This should be used in preference to SetLogWriter if the caller is also
|
2018-05-23 19:18:18 +00:00
|
|
|
// using slog.
|
|
|
|
|
func UseLogger(logger slog.Logger) {
|
2016-05-12 09:06:07 +00:00
|
|
|
log = logger
|
|
|
|
|
}
|