This repository has been archived by the owner on Feb 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdefault.go
228 lines (182 loc) · 6.29 KB
/
default.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
package gomol
var curDefault *Base
func init() {
curDefault = NewBase()
}
// Default will return the current default gomol Base logger
func Default() *Base {
return curDefault
}
// SetConfig executes the same function on the default Base instance
func SetConfig(config *Config) {
curDefault.SetConfig(config)
}
// SetErrorChan executes the same function on the default Base instance
func SetErrorChan(ch chan<- error) {
curDefault.SetErrorChan(ch)
}
// SetLogLevel executes the same function on the default Base instance
func SetLogLevel(level LogLevel) {
curDefault.SetLogLevel(level)
}
// SetFallbackLogger executes the same function on the default Base instance
func SetFallbackLogger(logger Logger) error {
return curDefault.SetFallbackLogger(logger)
}
// AddLogger executes the same function on the default Base instance
func AddLogger(logger Logger) {
curDefault.AddLogger(logger)
}
// RemoveLogger executes the same function on the default Base instance
func RemoveLogger(logger Logger) error {
return curDefault.RemoveLogger(logger)
}
// ClearLoggers executes the same function on the default Base instance
func ClearLoggers() error {
return curDefault.ClearLoggers()
}
// IsInitialized executes the same function on the default Base instance
func IsInitialized() bool {
return curDefault.IsInitialized()
}
// InitLoggers executes the same function on the default Base instance
func InitLoggers() error {
return curDefault.InitLoggers()
}
// Flush will wait until all messages currently queued are distributed to
// all initialized loggers
func Flush() {
curDefault.Flush()
}
// ShutdownLoggers executes the same function on the default Base instance
func ShutdownLoggers() error {
return curDefault.ShutdownLoggers()
}
// ClearAttrs executes the same function on the default Base instance
func ClearAttrs() {
curDefault.ClearAttrs()
}
// SetAttr executes the same function on the default Base instance
func SetAttr(key string, value interface{}) {
curDefault.SetAttr(key, value)
}
// GetAttr executes the same function on the default Base instance
func GetAttr(key string) interface{} {
return curDefault.GetAttr(key)
}
// RemoveAttr executes the same function on the default Base instance
func RemoveAttr(key string) {
curDefault.RemoveAttr(key)
}
// NewLogAdapter executes the same function on the default Base instance
func NewLogAdapter(attrs *Attrs) *LogAdapter {
return curDefault.NewLogAdapter(attrs)
}
// Dbg executes the same function on the default Base instance
func Dbg(msg string) error {
return Debug(msg)
}
// Dbgf executes the same function on the default Base instance
func Dbgf(msg string, a ...interface{}) error {
return Debugf(msg, a...)
}
// Dbgm executes the same function on the default Base instance
func Dbgm(m *Attrs, msg string, a ...interface{}) error {
return Debugm(m, msg, a...)
}
// Debug executes the same function on the default Base instance
func Debug(msg string) error {
return curDefault.Debug(msg)
}
// Debugf executes the same function on the default Base instance
func Debugf(msg string, a ...interface{}) error {
return curDefault.Debugf(msg, a...)
}
// Debugm executes the same function on the default Base instance
func Debugm(m *Attrs, msg string, a ...interface{}) error {
return curDefault.Debugm(m, msg, a...)
}
// Info executes the same function on the default Base instance
func Info(msg string) error {
return curDefault.Info(msg)
}
// Infof executes the same function on the default Base instance
func Infof(msg string, a ...interface{}) error {
return curDefault.Infof(msg, a...)
}
// Infom executes the same function on the default Base instance
func Infom(m *Attrs, msg string, a ...interface{}) error {
return curDefault.Infom(m, msg, a...)
}
// Warn executes the same function on the default Base instance
func Warn(msg string) error {
return Warning(msg)
}
// Warnf executes the same function on the default Base instance
func Warnf(msg string, a ...interface{}) error {
return Warningf(msg, a...)
}
// Warnm executes the same function on the default Base instance
func Warnm(m *Attrs, msg string, a ...interface{}) error {
return Warningm(m, msg, a...)
}
// Warning executes the same function on the default Base instance
func Warning(msg string) error {
return curDefault.Warning(msg)
}
// Warningf executes the same function on the default Base instance
func Warningf(msg string, a ...interface{}) error {
return curDefault.Warningf(msg, a...)
}
// Warningm executes the same function on the default Base instance
func Warningm(m *Attrs, msg string, a ...interface{}) error {
return curDefault.Warningm(m, msg, a...)
}
// Err executes the same function on the default Base instance
func Err(msg string) error {
return Error(msg)
}
// Errf executes the same function on the default Base instance
func Errf(msg string, a ...interface{}) error {
return Errorf(msg, a...)
}
// Errm executes the same function on the default Base instance
func Errm(m *Attrs, msg string, a ...interface{}) error {
return Errorm(m, msg, a...)
}
// Error executes the same function on the default Base instance
func Error(msg string) error {
return curDefault.Error(msg)
}
// Errorf executes the same function on the default Base instance
func Errorf(msg string, a ...interface{}) error {
return curDefault.Errorf(msg, a...)
}
// Errorm executes the same function on the default Base instance
func Errorm(m *Attrs, msg string, a ...interface{}) error {
return curDefault.Errorm(m, msg, a...)
}
// Fatal executes the same function on the default Base instance
func Fatal(msg string) error {
return curDefault.Fatal(msg)
}
// Fatalf executes the same function on the default Base instance
func Fatalf(msg string, a ...interface{}) error {
return curDefault.Fatalf(msg, a...)
}
// Fatalm executes the same function on the default Base instance
func Fatalm(m *Attrs, msg string, a ...interface{}) error {
return curDefault.Fatalm(m, msg, a...)
}
// Die executes the same function on the default Base instance
func Die(exitCode int, msg string) {
curDefault.Die(exitCode, msg)
}
// Dief executes the same function on the default Base instance
func Dief(exitCode int, msg string, a ...interface{}) {
curDefault.Dief(exitCode, msg, a...)
}
// Diem executes the same function on the default Base instance
func Diem(exitCode int, m *Attrs, msg string, a ...interface{}) {
curDefault.Diem(exitCode, m, msg, a...)
}