MCPcopy
hub / github.com/alibaba/MongoShake / TestDefaultLoggerIsSafeBeforeInitialization

Function TestDefaultLoggerIsSafeBeforeInitialization

pkg/log/logger_test.go:215–229  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

213}
214
215func TestDefaultLoggerIsSafeBeforeInitialization(t *testing.T) {
216 t.Helper()
217
218 previous := Logger
219 Logger = &ZapLogger{logger: zap.NewNop().Sugar()}
220 t.Cleanup(func() {
221 Logger = previous
222 })
223
224 Logger.Debugf("debug %d", 1)
225 Logger.Infof("info %d", 2)
226 Logger.Warnf("warn %d", 3)
227 Logger.Errorf("error %d", 4)
228 Logger.Criticalf("critical %d", 5)
229}
230
231func TestNewVerboseStdoutOnlyDoesNotRequireLogFile(t *testing.T) {
232 t.Helper()

Callers

nothing calls this directly

Calls 5

DebugfMethod · 0.80
InfofMethod · 0.80
WarnfMethod · 0.80
ErrorfMethod · 0.80
CriticalfMethod · 0.80

Tested by

no test coverage detected