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

Function TestSlogHandler_Warn

slog_test.go:72–82  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

70}
71
72func TestSlogHandler_Warn(t *testing.T) {
73 var buf bytes.Buffer
74 logger := newSlogLogger(&buf)
75
76 logger.Warn("warn msg")
77
78 m := decodeJSON(t, &buf)
79 if m["level"] != "warn" {
80 t.Errorf("expected level warn, got %v", m["level"])
81 }
82}
83
84func TestSlogHandler_Error(t *testing.T) {
85 var buf bytes.Buffer

Callers

nothing calls this directly

Calls 3

newSlogLoggerFunction · 0.85
decodeJSONFunction · 0.85
WarnMethod · 0.80

Tested by

no test coverage detected