(t *testing.T)
| 119 | } |
| 120 | |
| 121 | func TestNewStdLogAtPanics(t *testing.T) { |
| 122 | // include DPanicLevel here and enable Development in options |
| 123 | levels := []zapcore.Level{DPanicLevel, PanicLevel} |
| 124 | for _, level := range levels { |
| 125 | withLogger(t, DebugLevel, []Option{AddCaller(), Development()}, func(l *Logger, logs *observer.ObservedLogs) { |
| 126 | std, err := NewStdLogAt(l, level) |
| 127 | require.NoError(t, err, "Unexpected error") |
| 128 | assert.Panics(t, func() { std.Print("redirected") }, "Expected log to panic.") |
| 129 | checkStdLogMessage(t, "redirected", logs) |
| 130 | }) |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | func TestNewStdLogAtFatal(t *testing.T) { |
| 135 | withLogger(t, DebugLevel, []Option{AddCaller()}, func(l *Logger, logs *observer.ObservedLogs) { |
nothing calls this directly
no test coverage detected