(t *testing.T)
| 39 | } |
| 40 | |
| 41 | func 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 | |
| 56 | func TestSlogHandler_Debug(t *testing.T) { |
| 57 | var buf bytes.Buffer |
nothing calls this directly
no test coverage detected