(b *testing.B)
| 62 | } |
| 63 | |
| 64 | func BenchmarkFormatterJSON(b *testing.B) { |
| 65 | testHandler := logger.NewHandler(io.Discard, &logger.Config{ |
| 66 | Level: slog.LevelDebug, |
| 67 | Format: logger.FormatJSON, |
| 68 | }) |
| 69 | testLogger := slog.New(testHandler) |
| 70 | |
| 71 | b.ResetTimer() |
| 72 | |
| 73 | for b.Loop() { |
| 74 | testLogger.Info( |
| 75 | handlerBenchmarkMsg, |
| 76 | handlerBenchmarkAttrs..., |
| 77 | ) |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | func BenchmarkNativeText(b *testing.B) { |
| 82 | testHandler := slog.NewTextHandler(io.Discard, &slog.HandlerOptions{Level: slog.LevelDebug}) |
nothing calls this directly
no test coverage detected