MCPcopy
hub / github.com/benbjohnson/litestream / TestInitLog_PrettyHandler

Function TestInitLog_PrettyHandler

internal/log_test.go:12–21  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestInitLog_PrettyHandler(t *testing.T) {
13 var buf bytes.Buffer
14 internal.InitLog(&buf, "INFO", "pretty", false)
15 slog.Default().Info("test message")
16
17 output := buf.String()
18 if strings.Contains(output, "\x1b[") {
19 t.Fatalf("expected no ANSI codes for non-TTY writer, got: %q", output)
20 }
21}
22
23func TestInitLog_TextHandler(t *testing.T) {
24 var buf bytes.Buffer

Callers

nothing calls this directly

Calls 2

InitLogFunction · 0.92
StringMethod · 0.45

Tested by

no test coverage detected