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

Function TestNewStdLogAt

global_test.go:108–119  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

106}
107
108func TestNewStdLogAt(t *testing.T) {
109 // include DPanicLevel here, but do not include Development in options
110 levels := []zapcore.Level{DebugLevel, InfoLevel, WarnLevel, ErrorLevel, DPanicLevel}
111 for _, level := range levels {
112 withLogger(t, DebugLevel, []Option{AddCaller()}, func(l *Logger, logs *observer.ObservedLogs) {
113 std, err := NewStdLogAt(l, level)
114 require.NoError(t, err, "Unexpected error.")
115 std.Print("redirected")
116 checkStdLogMessage(t, "redirected", logs)
117 })
118 }
119}
120
121func TestNewStdLogAtPanics(t *testing.T) {
122 // include DPanicLevel here and enable Development in options

Callers

nothing calls this directly

Calls 5

AddCallerFunction · 0.85
NewStdLogAtFunction · 0.85
checkStdLogMessageFunction · 0.85
withLoggerFunction · 0.70
PrintMethod · 0.45

Tested by

no test coverage detected