MCPcopy
hub / github.com/akuity/kargo / TestLogger_Debug

Function TestLogger_Debug

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

Source from the content-addressed store, hash-verified

213}
214
215func TestLogger_Debug(t *testing.T) {
216 core, logs := observer.New(zapcore.DebugLevel)
217 // Wrap() has its own tests, so here we assume it works.
218 Wrap(zap.New(core)).Debug("test message", "component", "test")
219 // Examine captured logs...
220 require.Len(t, logs.All(), 1)
221 entry := logs.All()[0]
222 require.Equal(t, zapcore.DebugLevel, entry.Level)
223 require.Equal(t, "test message", entry.Message)
224 require.Equal(t, []zapcore.Field{zap.Any("component", "test")}, entry.Context)
225}
226
227func TestLogger_Trace(t *testing.T) {
228 // Build a logger with an observable core that ALSO uses outr custom

Callers

nothing calls this directly

Calls 3

WrapFunction · 0.85
DebugMethod · 0.80
LenMethod · 0.80

Tested by

no test coverage detected