func BenchmarkLog_formatting(b *testing.B) { err := log.SetOutputFile(os.DevNull) if err != nil { b.Fatalf("Could not set output file: %s", err) } log.SetLogLevel(log.LevelAll) for n := 0; n < b.N; n++ { log.Error("%s %d", "Hello", 1234) } }
func BenchmarkLog_basic(b *testing.B) { err := log.SetOutputFile(os.DevNull) if err != nil { b.Fatalf("Could not set output file: %s", err) } log.SetLogLevel(log.LevelAll) for n := 0; n < b.N; n++ { log.Error("Hello world") } }
func BenchmarkLog_struct(b *testing.B) { err := log.SetOutputFile(os.DevNull) if err != nil { b.Fatalf("Could not set output file: %s", err) } log.SetLogLevel(log.LevelAll) for n := 0; n < b.N; n++ { log.Error("%s %d %v", "Hello", 1234, struct{ s string }{"World"}) } }