-
Notifications
You must be signed in to change notification settings - Fork 7
/
benchmark_test.go
58 lines (56 loc) · 1.38 KB
/
benchmark_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package logger
//import (
// logger "github.com/wzyonggege/logger"
// "testing"
//)
//
//
//func BenchmarkLogger(b *testing.B) {
// b.Logf("Logging at a disabled level with some accumulated context.")
// b.Run("logde logger without fields", func(b *testing.B) {
// c := logger.New()
// c.CloseConsoleDisplay()
// c.InitLogger()
// b.ResetTimer()
// b.RunParallel(func(pb *testing.PB) {
// for pb.Next() {
// logger.Info("1234")
// }
// })
// })
// b.Run("logde logger with fields", func(b *testing.B) {
// c := logger.New()
// c.CloseConsoleDisplay()
// c.InitLogger()
// b.ResetTimer()
// b.RunParallel(func(pb *testing.PB) {
// for pb.Next() {
// logger.Info("1234", logger.With("Trace", "1234455"))
// }
// })
// })
// b.Run("logde logger without fields write into file", func(b *testing.B) {
// c := logger.New()
// c.CloseConsoleDisplay()
// c.SetInfoFile("../logs/test_stdout.log")
// c.InitLogger()
// b.ResetTimer()
// b.RunParallel(func(pb *testing.PB) {
// for pb.Next() {
// logger.Info("1234")
// }
// })
// })
// b.Run("logde logger with fields write into file", func(b *testing.B) {
// c := logger.New()
// c.CloseConsoleDisplay()
// c.SetInfoFile("../logs/test_stdout.log")
// c.InitLogger()
// b.ResetTimer()
// b.RunParallel(func(pb *testing.PB) {
// for pb.Next() {
// logger.Info("1234", logger.With("Trace", "1234455"))
// }
// })
// })
//}