Example demonstrates basic usage of the logger package.
()
| 23 | |
| 24 | // Example demonstrates basic usage of the logger package. |
| 25 | func 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. |
| 36 | func Example_withPrometheus() { |
nothing calls this directly
no test coverage detected
searching dependent graphs…