MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / BenchmarkFormatterJSON

Function BenchmarkFormatterJSON

logger/handler_test.go:64–79  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

62}
63
64func 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
81func BenchmarkNativeText(b *testing.B) {
82 testHandler := slog.NewTextHandler(io.Discard, &slog.HandlerOptions{Level: slog.LevelDebug})

Callers

nothing calls this directly

Calls 1

NewHandlerFunction · 0.92

Tested by

no test coverage detected