MCPcopy
hub / github.com/redpanda-data/console / TestDurationFormattingTextFormat

Function TestDurationFormattingTextFormat

backend/pkg/logger/logger_test.go:399–411  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

397}
398
399func TestDurationFormattingTextFormat(t *testing.T) {
400 var buf bytes.Buffer
401 logger := NewSlogLogger(
402 WithOutput(&buf),
403 WithFormat(FormatText),
404 )
405
406 logger.Info("test message", slog.Duration("duration", 6*time.Hour))
407
408 output := buf.String()
409 // Text format should also show human-readable duration
410 assert.Contains(t, output, "duration=6h0m0s")
411}

Callers

nothing calls this directly

Calls 4

NewSlogLoggerFunction · 0.85
WithOutputFunction · 0.85
WithFormatFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…