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

Function BenchmarkFormatterStructured

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

Source from the content-addressed store, hash-verified

45}
46
47func BenchmarkFormatterStructured(b *testing.B) {
48 testHandler := logger.NewHandler(io.Discard, &logger.Config{
49 Level: slog.LevelDebug,
50 Format: logger.FormatStructured,
51 })
52 testLogger := slog.New(testHandler)
53
54 b.ResetTimer()
55
56 for b.Loop() {
57 testLogger.Info(
58 handlerBenchmarkMsg,
59 handlerBenchmarkAttrs...,
60 )
61 }
62}
63
64func BenchmarkFormatterJSON(b *testing.B) {
65 testHandler := logger.NewHandler(io.Discard, &logger.Config{

Callers

nothing calls this directly

Calls 1

NewHandlerFunction · 0.92

Tested by

no test coverage detected