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

Function TestNewStdLogAtFatal

global_test.go:134–145  ·  global_test.go::TestNewStdLogAtFatal
(t *testing.T)

Source from the content-addressed store, hash-verified

132}
133
134func TestNewStdLogAtFatal(t *testing.T) {
135 withLogger(t, DebugLevel, []Option{AddCaller()}, func(l *Logger, logs *observer.ObservedLogs) {
136 stub := exit.WithStub(func() {
137 std, err := NewStdLogAt(l, FatalLevel)
138 require.NoError(t, err, "Unexpected error.")
139 std.Print("redirected")
140 checkStdLogMessage(t, "redirected", logs)
141 })
142 assert.True(t, true, stub.Exited, "Expected Fatal logger call to terminate process.")
143 stub.Unstub()
144 })
145}
146
147func TestNewStdLogAtInvalid(t *testing.T) {
148 _, err := NewStdLogAt(NewNop(), zapcore.Level(99))

Callers

nothing calls this directly

Calls 7

WithStubFunction · 0.92
AddCallerFunction · 0.85
NewStdLogAtFunction · 0.85
checkStdLogMessageFunction · 0.85
UnstubMethod · 0.80
withLoggerFunction · 0.70
PrintMethod · 0.45

Tested by

no test coverage detected