MCPcopy
hub / github.com/sirupsen/logrus / doLoggerBenchmarkWithFormatter

Function doLoggerBenchmarkWithFormatter

logger_bench_test.go:64–77  ·  view source on GitHub ↗
(b *testing.B, f Formatter)

Source from the content-addressed store, hash-verified

62}
63
64func doLoggerBenchmarkWithFormatter(b *testing.B, f Formatter) {
65 b.SetParallelism(100)
66 log := New()
67 log.Formatter = f
68 log.Out = io.Discard
69 b.RunParallel(func(pb *testing.PB) {
70 for pb.Next() {
71 log.
72 WithField("foo1", "bar1").
73 WithField("foo2", "bar2").
74 Info("this is a dummy log")
75 }
76 })
77}

Callers 2

Calls 3

NewFunction · 0.85
InfoMethod · 0.65
WithFieldMethod · 0.65

Tested by

no test coverage detected