-
Notifications
You must be signed in to change notification settings - Fork 0
/
handler.go
103 lines (78 loc) · 2.07 KB
/
handler.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
package jog
import (
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
type jLog struct {
zapLogger *zap.Logger
zapSugar *zap.SugaredLogger
}
func (jl *jLog) Debug(args ...any) {
jl.zapSugar.Debug(args...)
}
func (jl *jLog) Log(args ...any) {
jl.zapSugar.Log(zapcore.InfoLevel, args...)
}
func (jl *jLog) Info(args ...any) {
jl.zapSugar.Info(args...)
}
func (jl *jLog) Warn(args ...any) {
jl.zapSugar.Warn(args...)
}
func (jl *jLog) Error(args ...any) {
jl.zapSugar.Error(args...)
}
func (jl *jLog) Fatal(args ...any) {
jl.zapSugar.Fatal(args...)
}
func (jl *jLog) Panic(args ...any) {
jl.zapSugar.Panic(args...)
}
func (jl *jLog) Debugf(format string, args ...any) {
jl.zapSugar.Debugf(format, args...)
}
func (jl *jLog) Logf(format string, args ...any) {
jl.zapSugar.Logf(zapcore.InfoLevel, format, args...)
}
func (jl *jLog) Infof(format string, args ...any) {
jl.zapSugar.Infof(format, args...)
}
func (jl *jLog) Warnf(format string, args ...any) {
jl.zapSugar.Warnf(format, args...)
}
func (jl *jLog) Errorf(format string, args ...any) {
jl.zapSugar.Errorf(format, args...)
}
func (jl *jLog) Fatalf(format string, args ...any) {
jl.zapSugar.Fatalf(format, args...)
}
func (jl *jLog) Panicf(format string, args ...any) {
jl.zapSugar.Panicf(format, args...)
}
func (jl *jLog) Debugw(msg string, keysAndValues ...any) {
jl.zapSugar.Debugw(msg, keysAndValues...)
}
func (jl *jLog) Infow(msg string, keysAndValues ...any) {
jl.zapSugar.Infow(msg, keysAndValues...)
}
func (jl *jLog) Warnw(msg string, keysAndValues ...any) {
jl.zapSugar.Warnw(msg, keysAndValues...)
}
func (jl *jLog) Errorw(msg string, keysAndValues ...any) {
jl.zapSugar.Errorw(msg, keysAndValues...)
}
func (jl *jLog) Fatalw(msg string, keysAndValues ...any) {
jl.zapSugar.Fatalw(msg, keysAndValues...)
}
func (jl *jLog) Panicw(msg string, keysAndValues ...any) {
jl.zapSugar.Panicw(msg, keysAndValues...)
}
func (jl *jLog) GetZapLogger() *zap.Logger {
return jl.zapLogger
}
func (jl *jLog) GetZapSugarLogger() *zap.SugaredLogger {
return jl.zapSugar
}
func (jl *jLog) Close() {
jl.zapLogger.Sync()
}