MCPcopy
hub / github.com/rs/zerolog / TestLoggerShouldWithNilWriter

Function TestLoggerShouldWithNilWriter

log_test.go:1076–1084  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1074}
1075
1076func TestLoggerShouldWithNilWriter(t *testing.T) {
1077 // Create a logger with nil writer to test the should method's nil check
1078 log := Logger{w: nil, level: TraceLevel}
1079
1080 e := log.Info()
1081 if e != nil {
1082 t.Error("Expected nil event when writer is nil")
1083 }
1084}
1085
1086func TestContextTimestamp(t *testing.T) {
1087 TimestampFunc = func() time.Time {

Callers

nothing calls this directly

Calls 2

InfoMethod · 0.95
ErrorMethod · 0.45

Tested by

no test coverage detected