-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinterface.go
129 lines (97 loc) · 3.37 KB
/
interface.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
package logger
import "github.com/sirupsen/logrus"
type Logger interface {
Info(args ...interface{})
InfoWithFields(fs map[string]interface{}, args ...interface{})
Infof(format string, args ...interface{})
InfofWithFields(fs map[string]interface{}, format string, args ...interface{})
Warn(args ...interface{})
WarnWithFields(fs map[string]interface{}, args ...interface{})
Warnf(format string, args ...interface{})
WarnfWithFields(fs map[string]interface{}, format string, args ...interface{})
Debug(args ...interface{})
DebugWithFields(fs map[string]interface{}, args ...interface{})
Debugf(format string, args ...interface{})
DebugfWithFields(fs map[string]interface{}, format string, args ...interface{})
Fatal(v ...interface{})
FatalWithFields(fs map[string]interface{}, v ...interface{})
Error(args ...interface{})
ErrorWithFields(fs map[string]interface{}, args ...interface{})
Errorf(format string, args ...interface{})
ErrorfWithFields(fs map[string]interface{}, format string, args ...interface{})
Clone() Logger
ClearMDC()
MDCPut(key string, value interface{})
MDCRemove(key string)
}
// map[string]interface{}
var Default Logger = &myLogger{
l: logrus.New(),
config: config{
level: LevelInfo,
},
}
// ─── FUNCTIONS ──────────────────────────────────────────────────────────────────
// Info like log.Println()
func Info(args ...interface{}) {
Default.Info(args...)
}
// Infof like log.Printf()
func Infof(format string, args ...interface{}) {
Default.Infof(format, args...)
}
// Warn like log.Println()
func Warn(args ...interface{}) {
Default.Warn(args...)
}
// Warnf like log.Printf()
func Warnf(format string, args ...interface{}) {
Default.Warnf(format, args...)
}
// Fatal like log.Println()
func Debug(args ...interface{}) {
Default.Debug(args...)
}
// Debug like log.Println()
func Debugf(format string, args ...interface{}) {
Default.Debugf(format, args...)
}
// Debugf like log.Printf()
func Fatal(v ...interface{}) {
Default.Fatal(v...)
}
// Error like log.Println()
func Error(args ...interface{}) {
Default.Error(args...)
}
// Errorf like log.Printf()
func Errorf(format string, args ...interface{}) {
Default.Errorf(format, args...)
}
func InfoWithFields(fs map[string]interface{}, args ...interface{}) {
Default.InfoWithFields(fs, args...)
}
func InfofWithFields(fs map[string]interface{}, format string, args ...interface{}) {
Default.InfofWithFields(fs, format, args...)
}
func WarnWithFields(fs map[string]interface{}, args ...interface{}) {
Default.WarnWithFields(fs, args...)
}
func WarnfWithFields(fs map[string]interface{}, format string, args ...interface{}) {
Default.WarnfWithFields(fs, format, args...)
}
func DebugWithFields(fs map[string]interface{}, args ...interface{}) {
Default.DebugWithFields(fs, args...)
}
func DebugfWithFields(fs map[string]interface{}, format string, args ...interface{}) {
Default.DebugfWithFields(fs, format, args...)
}
func FatalWithFields(fs map[string]interface{}, v ...interface{}) {
Default.FatalWithFields(fs, v...)
}
func ErrorWithFields(fs map[string]interface{}, args ...interface{}) {
Default.ErrorWithFields(fs, args...)
}
func ErrorfWithFields(fs map[string]interface{}, format string, args ...interface{}) {
Default.ErrorfWithFields(fs, format, args...)
}