This file implements wrappers around the loggers of external packages so that all of SG's logging output is consistent
()
| 27 | // This file implements wrappers around the loggers of external packages |
| 28 | // so that all of SG's logging output is consistent |
| 29 | func 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 | |
| 49 | func updateExternalLoggers() { |
| 50 | // use context.Background() since this is called from init or to reset test logging |
no test coverage detected