MCPcopy Create free account
hub / github.com/AdRoll/baker / DisableLogging

Function DisableLogging

testutil/helpers.go:79–83  ·  view source on GitHub ↗

DisableLogging is a test helper that disable logging (in fact it sets its level to panic). It returns a function which when called, resets it to its previous level. Its useful to be called as follows in test/benchmarks: func TestFoo(t *testing.T) { defer DisableLogging()() logging is disabled for

()

Source from the content-addressed store, hash-verified

77// // logging is disabled for the whole test
78// }
79func DisableLogging() (reset func()) {
80 lvl := log.GetLevel()
81 log.SetLevel(log.PanicLevel)
82 return func() { log.SetLevel(lvl) }
83}
84
85// LessLogging is a test helper that decreases logging (in fact it sets its
86// level to Error). It returns a function which when called, resets it to its

Callers 12

TestFileWriterRotateSizeFunction · 0.92
BenchmarkFilesOutputFunction · 0.92
TestS3UploadFunction · 0.92
TestS3_uploadDirectoryFunction · 0.92
TestS3RunExitOnErrorFunction · 0.92
TestS3RunNotExitOnErrorFunction · 0.92
testIntegrationS3Function · 0.92
TestListS3FolderFunction · 0.92
TestListS3ManifestFunction · 0.92

Calls

no outgoing calls

Tested by 12

TestFileWriterRotateSizeFunction · 0.74
BenchmarkFilesOutputFunction · 0.74
TestS3UploadFunction · 0.74
TestS3_uploadDirectoryFunction · 0.74
TestS3RunExitOnErrorFunction · 0.74
TestS3RunNotExitOnErrorFunction · 0.74
testIntegrationS3Function · 0.74
TestListS3FolderFunction · 0.74
TestListS3ManifestFunction · 0.74