mirror of
https://github.com/status-im/status-go.git
synced 2025-01-09 22:26:30 +00:00
eeca435064
Update vendor Integrate rendezvous into status node Add a test with failover using rendezvous Use multiple servers in client Use discovery V5 by default and test that node can be started with rendezvous discovet Fix linter Update rendezvous client to one with instrumented stream Address feedback Fix test with updated topic limits Apply several suggestions Change log to debug for request errors because we continue execution Remove web3js after rebase Update rendezvous package
40 lines
1.1 KiB
Go
40 lines
1.1 KiB
Go
// Copyright 2013, Örjan Persson. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package logging
|
|
|
|
// defaultBackend is the backend used for all logging calls.
|
|
var defaultBackend LeveledBackend
|
|
|
|
// Backend is the interface which a log backend need to implement to be able to
|
|
// be used as a logging backend.
|
|
type Backend interface {
|
|
Log(Level, int, *Record) error
|
|
}
|
|
|
|
// Set backend replaces the backend currently set with the given new logging
|
|
// backend.
|
|
func SetBackend(backends ...Backend) LeveledBackend {
|
|
var backend Backend
|
|
if len(backends) == 1 {
|
|
backend = backends[0]
|
|
} else {
|
|
backend = MultiLogger(backends...)
|
|
}
|
|
|
|
defaultBackend = AddModuleLevel(backend)
|
|
return defaultBackend
|
|
}
|
|
|
|
// SetLevel sets the logging level for the specified module. The module
|
|
// corresponds to the string specified in GetLogger.
|
|
func SetLevel(level Level, module string) {
|
|
defaultBackend.SetLevel(level, module)
|
|
}
|
|
|
|
// GetLevel returns the logging level for the specified module.
|
|
func GetLevel(module string) Level {
|
|
return defaultBackend.GetLevel(module)
|
|
}
|