MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / TestNewLogger_WithCustomOutput

Function TestNewLogger_WithCustomOutput

internal/logger/logger_test.go:50–66  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

48}
49
50func TestNewLogger_WithCustomOutput(t *testing.T) {
51 var buf bytes.Buffer
52 config := &Config{
53 Level: LevelDebug,
54 Output: &buf,
55 }
56
57 logger, err := NewLogger(config)
58 require.NoError(t, err)
59 defer logger.Close()
60
61 logger.Info("test message")
62
63 output := buf.String()
64 assert.Contains(t, output, "[INFO]")
65 assert.Contains(t, output, "test message")
66}
67
68func TestNewLogger_WithFileOutput(t *testing.T) {
69 // Create temporary directory

Callers

nothing calls this directly

Calls 4

CloseMethod · 0.95
InfoMethod · 0.95
NewLoggerFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected