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

Function TestSlogHandler_WithStringAttr

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

Source from the content-addressed store, hash-verified

94}
95
96func TestSlogHandler_WithStringAttr(t *testing.T) {
97 var buf bytes.Buffer
98 logger := newSlogLogger(&buf)
99
100 logger.Info("test", "key", "value")
101
102 m := decodeJSON(t, &buf)
103 if m["key"] != "value" {
104 t.Errorf("expected key=value, got %v", m["key"])
105 }
106}
107
108func TestSlogHandler_WithIntAttr(t *testing.T) {
109 var buf bytes.Buffer

Callers

nothing calls this directly

Calls 3

newSlogLoggerFunction · 0.85
decodeJSONFunction · 0.85
InfoMethod · 0.65

Tested by

no test coverage detected