-
Notifications
You must be signed in to change notification settings - Fork 2
/
simple.go
87 lines (72 loc) · 2.21 KB
/
simple.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package logbus
import "go.uber.org/zap"
// default logger provided
var newGlobalGLogger NewILogger
func Debug(msg string, v ...Field) {
newGlobalGLogger.Debug(msg, v...)
}
func Info(msg string, v ...Field) {
newGlobalGLogger.Info(msg, v...)
}
func Warn(msg string, v ...Field) {
newGlobalGLogger.Warn(msg, v...)
}
func Error(msg string, v ...Field) {
newGlobalGLogger.Error(msg, v...)
}
func Panic(msg string, v ...Field) {
newGlobalGLogger.Panic(msg, v...)
}
func Fatal(msg string, v ...Field) {
newGlobalGLogger.Fatal(msg, v...)
}
// WithChannel
func DebugWithChannel(c string, msg string, fields ...Field) {
newGlobalGLogger.DebugWithChannel(c, msg, fields...)
}
func InfoWithChannel(c string, msg string, fields ...Field) {
newGlobalGLogger.InfoWithChannel(c, msg, fields...)
}
func WarnWithChannel(c string, msg string, fields ...Field) {
newGlobalGLogger.WarnWithChannel(c, msg, fields...)
}
func ErrorWithChannel(c string, msg string, fields ...Field) {
newGlobalGLogger.ErrorWithChannel(c, msg, fields...)
}
func DPanicWithChannel(c string, msg string, fields ...Field) {
newGlobalGLogger.DPanicWithChannel(c, msg, fields...)
}
func PanicWithChannel(c string, msg string, fields ...Field) {
newGlobalGLogger.PanicWithChannel(c, msg, fields...)
}
func FatalWithChannel(c string, msg string, fields ...Field) {
newGlobalGLogger.FatalWithChannel(c, msg, fields...)
}
// DebugDepth 用于glog被再封装
func DebugDepth(depth int, msg string, v ...Field) {
newGlobalGLogger.GDebugDepth(depth, msg, v...)
}
// InfoDepth 用于glog被再封装
func InfoDepth(depth int, msg string, v ...Field) {
newGlobalGLogger.GInfoDepth(depth, msg, v...)
}
// WarnDepth 用于glog被再封装
func WarnDepth(depth int, msg string, v ...Field) {
newGlobalGLogger.GWarnDepth(depth, msg, v...)
}
// ErrorDepth 用于glog被再封装
func ErrorDepth(depth int, msg string, v ...Field) {
newGlobalGLogger.GErrorDepth(depth, msg, v...)
}
// FatalDepth 用于glog被再封装
func FatalDepth(depth int, msg string, v ...Field) {
newGlobalGLogger.GFatalDepth(depth, msg, v...)
}
// GetZapLogger
func GetZapLogger() *zap.Logger {
from, ok := newGlobalGLogger.(GLoggerVisitor)
if !ok {
return nil
}
return from.GetStdLogger().getZapLogger()
}