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

Function TestSlogHandler_WithIntAttr

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

Source from the content-addressed store, hash-verified

106}
107
108func TestSlogHandler_WithIntAttr(t *testing.T) {
109 var buf bytes.Buffer
110 logger := newSlogLogger(&buf)
111
112 logger.Info("test", slog.Int("count", 42))
113
114 m := decodeJSON(t, &buf)
115 if m["count"] != float64(42) {
116 t.Errorf("expected count=42, got %v", m["count"])
117 }
118}
119
120func TestSlogHandler_WithBoolAttr(t *testing.T) {
121 var buf bytes.Buffer

Callers

nothing calls this directly

Calls 4

newSlogLoggerFunction · 0.85
decodeJSONFunction · 0.85
InfoMethod · 0.65
IntMethod · 0.45

Tested by

no test coverage detected