forked from sirupsen/logrus
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwizard2.go
242 lines (185 loc) · 6.94 KB
/
wizard2.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
package logrus
import (
"github.com/kr/pretty"
)
var (
FieldsLogger = std
)
func SetFieldsLogger(loger *Logger) {
loger.mu.Lock()
defer loger.mu.Unlock()
FieldsLogger = loger
}
func (f Fields) Tracef(format string, args ...interface{}) {
FieldsLogger.WithFields(f).Tracef(format, args...)
}
func (f Fields) Debugf(format string, args ...interface{}) {
FieldsLogger.WithFields(f).Debugf(format, args...)
}
func (f Fields) Infof(format string, args ...interface{}) {
FieldsLogger.WithFields(f).Infof(format, args...)
}
func (f Fields) Printf(format string, args ...interface{}) {
FieldsLogger.WithFields(f).Printf(format, args...)
}
func (f Fields) Warnf(format string, args ...interface{}) {
FieldsLogger.WithFields(f).Warnf(format, args...)
}
func (f Fields) Warningf(format string, args ...interface{}) {
FieldsLogger.WithFields(f).Warnf(format, args...)
}
func (f Fields) Errorf(format string, args ...interface{}) {
FieldsLogger.WithFields(f).Errorf(format, args...)
}
func (f Fields) Fatalf(format string, args ...interface{}) {
FieldsLogger.WithFields(f).Fatalf(format, args...)
}
func (f Fields) Panicf(format string, args ...interface{}) {
FieldsLogger.WithFields(f).Panicf(format, args...)
}
func (f Fields) Trace(args ...interface{}) {
FieldsLogger.WithFields(f).Trace(args...)
}
func (f Fields) Debug(args ...interface{}) {
FieldsLogger.WithFields(f).Debug(args...)
}
func (f Fields) Info(args ...interface{}) {
FieldsLogger.WithFields(f).Info(args...)
}
func (f Fields) Print(args ...interface{}) {
FieldsLogger.WithFields(f).Info(args...)
}
func (f Fields) Warn(args ...interface{}) {
FieldsLogger.WithFields(f).Warn(args...)
}
func (f Fields) Warning(args ...interface{}) {
FieldsLogger.WithFields(f).Warn(args...)
}
func (f Fields) Error(args ...interface{}) {
FieldsLogger.WithFields(f).Error(args...)
}
func (f Fields) Fatal(args ...interface{}) {
FieldsLogger.WithFields(f).Fatal(args...)
}
func (f Fields) Panic(args ...interface{}) {
FieldsLogger.WithFields(f).Panic(args...)
}
func (f Fields) Traceln(args ...interface{}) {
FieldsLogger.WithFields(f).Traceln(args...)
}
func (f Fields) Debugln(args ...interface{}) {
FieldsLogger.WithFields(f).Debugln(args...)
}
func (f Fields) Infoln(args ...interface{}) {
FieldsLogger.WithFields(f).Infoln(args...)
}
func (f Fields) Println(args ...interface{}) {
FieldsLogger.WithFields(f).Println(args...)
}
func (f Fields) Warnln(args ...interface{}) {
FieldsLogger.WithFields(f).Warnln(args...)
}
func (f Fields) Warningln(args ...interface{}) {
FieldsLogger.WithFields(f).Warnln(args...)
}
func (f Fields) Errorln(args ...interface{}) {
FieldsLogger.WithFields(f).Errorln(args...)
}
func (f Fields) Fatalln(args ...interface{}) {
FieldsLogger.WithFields(f).Fatalln(args...)
}
func (f Fields) Panicln(args ...interface{}) {
FieldsLogger.WithFields(f).Panicln(args...)
}
// for fields to pretty printing for Go values
func (f Fields) Tracefp(format string, args ...interface{}) {
FieldsLogger.WithFields(f).Tracef(format+" ==>%# v", pretty.Formatter(args))
}
func (f Fields) Debugfp(format string, args ...interface{}) {
FieldsLogger.WithFields(f).Debugf(format+" ==>%# v", pretty.Formatter(args))
}
func (f Fields) Infofp(format string, args ...interface{}) {
FieldsLogger.WithFields(f).Infof(format+" ==>%# v", pretty.Formatter(args))
}
func (f Fields) Printfp(format string, args ...interface{}) {
FieldsLogger.WithFields(f).Printf(format+" ==>%# v", pretty.Formatter(args))
}
func (f Fields) Warnfp(format string, args ...interface{}) {
FieldsLogger.WithFields(f).Warnf(format+" ==>%# v", pretty.Formatter(args))
}
func (f Fields) Warningfp(format string, args ...interface{}) {
FieldsLogger.WithFields(f).Warnf(format+" ==>%# v", pretty.Formatter(args))
}
func (f Fields) Errorfp(format string, args ...interface{}) {
FieldsLogger.WithFields(f).Errorf(format+" ==>%# v", pretty.Formatter(args))
}
func (f Fields) Fatalfp(format string, args ...interface{}) {
FieldsLogger.WithFields(f).Fatalf(format+" ==>%# v", pretty.Formatter(args))
}
func (f Fields) Panicfp(format string, args ...interface{}) {
FieldsLogger.WithFields(f).Panicf(format+" ==>%# v", pretty.Formatter(args))
}
// exported, for logrus to pretty printing for Go values
func Tracefp(format string, args ...interface{}) {
FieldsLogger.Tracef(format+" ==>%# v", pretty.Formatter(args))
}
// Debugf logs a message at level Debug on the standard logger.
func Debugfp(format string, args ...interface{}) {
FieldsLogger.Debugf(format+" ==>%# v", pretty.Formatter(args))
}
// Printf logs a message at level Info on the standard logger.
func Printfp(format string, args ...interface{}) {
FieldsLogger.Printf(format+" ==>%# v", pretty.Formatter(args))
}
// Infof logs a message at level Info on the standard logger.
func Infofp(format string, args ...interface{}) {
FieldsLogger.Infof(format+" ==>%# v", pretty.Formatter(args))
}
// Warnf logs a message at level Warn on the standard logger.
func Warnfp(format string, args ...interface{}) {
FieldsLogger.Warnf(format+" ==>%# v", pretty.Formatter(args))
}
// Warningf logs a message at level Warn on the standard logger.
func Warningfp(format string, args ...interface{}) {
FieldsLogger.Warnf(format+" ==>%# v", pretty.Formatter(args))
}
// Errorf logs a message at level Error on the standard logger.
func Errorfp(format string, args ...interface{}) {
FieldsLogger.Errorf(format+" ==>%# v", pretty.Formatter(args))
}
// Panicf logs a message at level Panic on the standard logger.
func Panicfp(format string, args ...interface{}) {
FieldsLogger.Panicf(format+" ==>%# v", pretty.Formatter(args))
}
// Fatalf logs a message at level Fatal on the standard logger.
func Fatalfp(format string, args ...interface{}) {
FieldsLogger.Fatalf(format+" ==>%# v", pretty.Formatter(args))
}
// for logger to pretty printing for Go values
func (logger *Logger) Tracefp(format string, args ...interface{}) {
FieldsLogger.Trace(format+" ==>%# v", pretty.Formatter(args))
}
func (logger *Logger) Debugfp(format string, args ...interface{}) {
FieldsLogger.Debug(format+" ==>%# v", pretty.Formatter(args))
}
func (logger *Logger) Infofp(format string, args ...interface{}) {
FieldsLogger.Infof(format+" ==>%# v", pretty.Formatter(args))
}
func (logger *Logger) Printfp(format string, args ...interface{}) {
FieldsLogger.Printf(format+" ==>%# v", pretty.Formatter(args))
}
func (logger *Logger) Warnfp(format string, args ...interface{}) {
FieldsLogger.Warnf(format+" ==>%# v", pretty.Formatter(args))
}
func (logger *Logger) Warningfp(format string, args ...interface{}) {
FieldsLogger.Warnf(format+" ==>%# v", pretty.Formatter(args))
}
func (logger *Logger) Errorfp(format string, args ...interface{}) {
FieldsLogger.Errorf(format+" ==>%# v", pretty.Formatter(args))
}
func (logger *Logger) Fatalfp(format string, args ...interface{}) {
FieldsLogger.Fatalf(format+" ==>%# v", pretty.Formatter(args))
}
func (logger *Logger) Panicfp(format string, args ...interface{}) {
FieldsLogger.Panicf(format+" ==>%# v", pretty.Formatter(args))
}