MCPcopy
hub / github.com/op/go-logging / SetBackend

Function SetBackend

backend.go:18–28  ·  view source on GitHub ↗

SetBackend replaces the backend currently set with the given new logging backend.

(backends ...Backend)

Source from the content-addressed store, hash-verified

16// SetBackend replaces the backend currently set with the given new logging
17// backend.
18func SetBackend(backends ...Backend) LeveledBackend {
19 var backend Backend
20 if len(backends) == 1 {
21 backend = backends[0]
22 } else {
23 backend = MultiLogger(backends...)
24 }
25
26 defaultBackend = AddModuleLevel(backend)
27 return defaultBackend
28}
29
30// SetLevel sets the logging level for the specified module. The module
31// corresponds to the string specified in GetLogger.

Callers 15

TestBackendFormatterFunction · 0.85
TestMultiLoggerFunction · 0.85
TestMultiLoggerLevelFunction · 0.85
TestLogCalldepthFunction · 0.85
testCallpathFunction · 0.85
BenchmarkLogLeveledFunction · 0.85
BenchmarkLogLogBackendFunction · 0.85

Calls 2

MultiLoggerFunction · 0.85
AddModuleLevelFunction · 0.85

Tested by 15

TestBackendFormatterFunction · 0.68
TestMultiLoggerFunction · 0.68
TestMultiLoggerLevelFunction · 0.68
TestLogCalldepthFunction · 0.68
testCallpathFunction · 0.68
BenchmarkLogLeveledFunction · 0.68
BenchmarkLogLogBackendFunction · 0.68