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

Function doLoggerBenchmark

logger_bench_test.go:27–39  ·  view source on GitHub ↗
(b *testing.B, out *os.File, formatter Formatter, fields Fields)

Source from the content-addressed store, hash-verified

25}
26
27func doLoggerBenchmark(b *testing.B, out *os.File, formatter Formatter, fields Fields) {
28 logger := Logger{
29 Out: out,
30 Level: InfoLevel,
31 Formatter: formatter,
32 }
33 entry := logger.WithFields(fields)
34 b.RunParallel(func(pb *testing.PB) {
35 for pb.Next() {
36 entry.Info("aaa")
37 }
38 })
39}
40
41func doLoggerBenchmarkNoLock(b *testing.B, out *os.File, formatter Formatter, fields Fields) {
42 logger := Logger{

Callers 1

BenchmarkDummyLoggerFunction · 0.85

Calls 2

WithFieldsMethod · 0.95
InfoMethod · 0.65

Tested by

no test coverage detected