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

Function Example

backend/pkg/logger/example_test.go:25–33  ·  view source on GitHub ↗

Example demonstrates basic usage of the logger package.

()

Source from the content-addressed store, hash-verified

23
24// Example demonstrates basic usage of the logger package.
25func Example() {
26 // Create a simple logger
27 log := logger.NewSlogLogger(
28 logger.WithLevel(slog.LevelInfo),
29 )
30
31 ctx := context.Background()
32 log.InfoContext(ctx, "application started", slog.String("version", "1.0.0"))
33}
34
35// Example_withPrometheus demonstrates using the logger with Prometheus metrics.
36func Example_withPrometheus() {

Callers

nothing calls this directly

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…