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

Function TestSlogHandler_Error

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

Source from the content-addressed store, hash-verified

82}
83
84func TestSlogHandler_Error(t *testing.T) {
85 var buf bytes.Buffer
86 logger := newSlogLogger(&buf)
87
88 logger.Error("error msg")
89
90 m := decodeJSON(t, &buf)
91 if m["level"] != "error" {
92 t.Errorf("expected level error, got %v", m["level"])
93 }
94}
95
96func TestSlogHandler_WithStringAttr(t *testing.T) {
97 var buf bytes.Buffer

Callers

nothing calls this directly

Calls 3

newSlogLoggerFunction · 0.85
decodeJSONFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected