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

Function TestSlogHandler_BasicInfo

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

Source from the content-addressed store, hash-verified

39}
40
41func TestSlogHandler_BasicInfo(t *testing.T) {
42 var buf bytes.Buffer
43 logger := newSlogLogger(&buf)
44
45 logger.Info("hello world")
46
47 m := decodeJSON(t, &buf)
48 if m["level"] != "info" {
49 t.Errorf("expected level info, got %v", m["level"])
50 }
51 if m["message"] != "hello world" {
52 t.Errorf("expected message 'hello world', got %v", m["message"])
53 }
54}
55
56func TestSlogHandler_Debug(t *testing.T) {
57 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