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

Function SetUpTestLogging

base/util_testing.go:589–594  ·  view source on GitHub ↗

SetUpTestLogging will set the given log level and log keys, and revert the changes at the end of the current test. This function will panic if called multiple times in the same test.

(tb testing.TB, logLevel LogLevel, logKeys ...LogKey)

Source from the content-addressed store, hash-verified

587//
588// This function will panic if called multiple times in the same test.
589func SetUpTestLogging(tb testing.TB, logLevel LogLevel, logKeys ...LogKey) {
590 caller := GetCallersName(1, false)
591 InfofCtx(context.Background(), KeyAll, "%s: Setup logging: level: %v - keys: %v", caller, logLevel, logKeys)
592 cleanup := setTestLogging(logLevel, caller, logKeys...)
593 tb.Cleanup(cleanup)
594}
595
596// ResetGlobalTestLogging will ensure that the loggers are replaced at the end of the the test.
597func ResetGlobalTestLogging(t *testing.T) {

Calls 3

GetCallersNameFunction · 0.85
setTestLoggingFunction · 0.85
InfofCtxFunction · 0.70