-
Notifications
You must be signed in to change notification settings - Fork 0
/
logger.go
65 lines (50 loc) · 1.52 KB
/
logger.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
package logger
import (
"context"
)
type ILogger interface {
Panic(msg string, keysAndValues ...any)
Panicf(format string, args ...any)
Panicc(ctx context.Context, msg string, keysAndValues ...any)
Paniccf(ctx context.Context, format string, args ...any)
Error(msg string, keysAndValues ...any)
Errorf(format string, args ...any)
Errorc(ctx context.Context, msg string, keysAndValues ...any)
Errorcf(ctx context.Context, format string, args ...any)
Info(msg string, keysAndValues ...any)
Infof(format string, args ...any)
Infoc(ctx context.Context, msg string, keysAndValues ...any)
Infocf(ctx context.Context, format string, args ...any)
Debug(msg string, keysAndValues ...any)
Debugf(format string, args ...any)
Debugc(ctx context.Context, msg string, keysAndValues ...any)
Debugcf(ctx context.Context, format string, args ...any)
}
var log ILogger
func SetLogger(l ILogger) {
log = l
}
func Panic(msg string, keysAndValues ...any) {
log.Panic(msg, keysAndValues...)
}
func Panicf(template string, args ...any) {
log.Panicf(template, args...)
}
func Error(msg string, keysAndValues ...any) {
log.Error(msg, keysAndValues...)
}
func Errorf(template string, args ...any) {
log.Errorf(template, args...)
}
func Info(msg string, keysAndValues ...any) {
log.Info(msg, keysAndValues...)
}
func Infof(template string, args ...any) {
log.Infof(template, args...)
}
func Debug(msg string, keysAndValues ...any) {
log.Debug(msg, keysAndValues...)
}
func Debugf(template string, args ...any) {
log.Debugf(template, args...)
}