MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / initExternalLoggers

Function initExternalLoggers

base/logger_external.go:29–47  ·  view source on GitHub ↗

This file implements wrappers around the loggers of external packages so that all of SG's logging output is consistent

()

Source from the content-addressed store, hash-verified

27// This file implements wrappers around the loggers of external packages
28// so that all of SG's logging output is consistent
29func initExternalLoggers() {
30 if remapGoCBLogLevels {
31 gocb.SetLogger(GoCBLoggerRemapped{})
32 gocbcore.SetLogger(GoCBCoreLoggerRemapped{})
33 } else {
34 gocb.SetLogger(GoCBLogger{})
35 gocbcore.SetLogger(GoCBCoreLogger{})
36 }
37
38 logging.SetLogger(CBGoUtilsLogger{})
39 clog.SetLoggerCallback(ClogCallback)
40 // Set the clog level to DEBUG and do filtering for debug inside ClogCallback functions
41 clog.SetLevel(clog.LevelDebug)
42
43 // Redirect Walrus logging to SG logs, and set an appropriate level:
44 rosmar.LoggingCallback = rosmarLogger
45
46 updateExternalLoggers()
47}
48
49func updateExternalLoggers() {
50 // use context.Background() since this is called from init or to reset test logging

Callers 2

InitLoggingFunction · 0.85
initializeLoggersFunction · 0.85

Calls 2

updateExternalLoggersFunction · 0.85
SetLevelMethod · 0.80

Tested by

no test coverage detected