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

Function WithOutput

backend/pkg/logger/options.go:35–39  ·  view source on GitHub ↗

WithOutput sets the output writer for the logger. Common use cases: - Testing: WithOutput(&bytes.Buffer{}) to capture logs - File logging: WithOutput(file) to write to a file - Custom writers: WithOutput(customWriter) for external systems

(w io.Writer)

Source from the content-addressed store, hash-verified

33// - File logging: WithOutput(file) to write to a file
34// - Custom writers: WithOutput(customWriter) for external systems
35func WithOutput(w io.Writer) Option {
36 return func(c *config) {
37 c.output = w
38 }
39}
40
41// WithPrometheusRegistry configures the logger to emit metrics to the provided registry.
42func WithPrometheusRegistry(reg prometheus.Registerer, metricsNamespace string) Option {

Callers 13

TestNewSlogLoggerFunction · 0.85
TestLoggerMethodsFunction · 0.85
TestWithLevelFunction · 0.85
TestLoggerWithFunction · 0.85
TestStructuredLoggingFunction · 0.85
TestWithFormatFunction · 0.85
TestDefaultFormatFunction · 0.85
TestFormatOverrideFunction · 0.85
TestDurationFormattingFunction · 0.85
TestPrometheusHandlerFunction · 0.85

Calls

no outgoing calls

Tested by 13

TestNewSlogLoggerFunction · 0.68
TestLoggerMethodsFunction · 0.68
TestWithLevelFunction · 0.68
TestLoggerWithFunction · 0.68
TestStructuredLoggingFunction · 0.68
TestWithFormatFunction · 0.68
TestDefaultFormatFunction · 0.68
TestFormatOverrideFunction · 0.68
TestDurationFormattingFunction · 0.68
TestPrometheusHandlerFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…