MCPcopy
hub / github.com/uber-go/zap / checkStdLogMessage

Function checkStdLogMessage

global_test.go:270–281  ·  view source on GitHub ↗
(t *testing.T, msg string, logs *observer.ObservedLogs)

Source from the content-addressed store, hash-verified

268}
269
270func checkStdLogMessage(t *testing.T, msg string, logs *observer.ObservedLogs) {
271 require.Equal(t, 1, logs.Len(), "Expected exactly one entry to be logged")
272 entry := logs.AllUntimed()[0]
273 assert.Equal(t, []Field{}, entry.Context, "Unexpected entry context.")
274 assert.Equal(t, "redirected", entry.Message, "Unexpected entry message.")
275 assert.Regexp(
276 t,
277 `/global_test.go:\d+$`,
278 entry.Caller.String(),
279 "Unexpected caller annotation.",
280 )
281}

Callers 6

TestNewStdLogFunction · 0.85
TestNewStdLogAtFunction · 0.85
TestNewStdLogAtPanicsFunction · 0.85
TestNewStdLogAtFatalFunction · 0.85

Calls 3

AllUntimedMethod · 0.80
LenMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected