-
Notifications
You must be signed in to change notification settings - Fork 1
/
caller.go
150 lines (122 loc) · 4.27 KB
/
caller.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
package zapper
type Caller interface {
Debug(...any)
DebugF(string, ...any)
DebugW(string, ...any)
Info(...any)
InfoF(string, ...any)
InfoW(string, ...any)
Warn(...any)
WarnF(string, ...any)
WarnW(string, ...any)
Error(...any)
ErrorF(string, ...any)
ErrorW(string, ...any)
DPanic(...any)
DPanicF(string, ...any)
DPanicW(string, ...any)
Panic(...any)
PanicF(string, ...any)
PanicW(string, ...any)
Fatal(...any)
FatalF(string, ...any)
FatalW(string, ...any)
}
// Debug uses fmt.Sprint to construct and log a message
func (z *Zap) Debug(args ...any) {
z.debug(z.sugar, args...)
}
// DebugF uses fmt.Sprintf to log a templated message
func (z *Zap) DebugF(message string, args ...any) {
z.debugF(z.sugar, message, args...)
}
// DebugW logs a message with some additional context. The variadic key-value
// pairs are treated as they are in With.
//
// When debug-level logging is disabled, this is much faster than
//
// s.With(keysAndValues).Debug(msg)
func (z *Zap) DebugW(message string, keyAndValues ...any) {
z.debugW(z.sugar, message, keyAndValues...)
}
// Info uses fmt.Sprint to construct and log a message
func (z *Zap) Info(args ...any) {
z.info(z.sugar, args...)
}
// InfoF uses fmt.Sprintf to log a templated message
func (z *Zap) InfoF(message string, args ...any) {
z.infoF(z.sugar, message, args...)
}
// InfoW logs a message with some additional context. The variadic key-value
// pairs are treated as they are in With
func (z *Zap) InfoW(message string, keyAndValues ...any) {
z.infoW(z.sugar, message, keyAndValues...)
}
// Warn uses fmt.Sprint to construct and log a message
func (z *Zap) Warn(args ...any) {
z.warn(z.sugar, args...)
}
// WarnF uses fmt.Sprintf to log a templated message
func (z *Zap) WarnF(message string, args ...any) {
z.warnF(z.sugar, message, args...)
}
// WarnW logs a message with some additional context. The variadic key-value
// pairs are treated as they are in With
func (z *Zap) WarnW(message string, keyAndValues ...any) {
z.warnW(z.sugar, message, keyAndValues...)
}
// Error uses fmt.Sprint to construct and log a message
func (z *Zap) Error(args ...any) {
z.error(z.sugar, args...)
}
// ErrorF uses fmt.Sprintf to log a templated message
func (z *Zap) ErrorF(message string, args ...any) {
z.errorF(z.sugar, message, args...)
}
// ErrorW logs a message with some additional context. The variadic key-value
// pairs are treated as they are in With
func (z *Zap) ErrorW(message string, keyAndValues ...any) {
z.errorW(z.sugar, message, keyAndValues...)
}
// DPanic uses fmt.Sprint to construct and log a message. In development, the
// logger then panics. (See DPanicLevel for details.)
func (z *Zap) DPanic(args ...any) {
z.dPanic(z.sugar, args...)
}
// DPanicF uses fmt.Sprintf to log a templated message. In development, the
// logger then panics. (See DPanicLevel for details.)
func (z *Zap) DPanicF(message string, args ...any) {
z.dPanicF(z.sugar, message, args...)
}
// DPanicW logs a message with some additional context. In development, the
// logger then panics. (See DPanicLevel for details.) The variadic key-value
// pairs are treated as they are in With
func (z *Zap) DPanicW(message string, keyAndValues ...any) {
z.dPanicW(z.sugar, message, keyAndValues...)
}
// Panic uses fmt.Sprint to construct and log a message, then panics.
func (z *Zap) Panic(args ...any) {
z.panic(z.sugar, args...)
}
// PanicF uses fmt.Sprintf to log a templated message, then panics
func (z *Zap) PanicF(message string, args ...any) {
z.panicF(z.sugar, message, args...)
}
// PanicW logs a message with some additional context, then panics. The
// variadic key-value pairs are treated as they are in With
func (z *Zap) PanicW(message string, keyAndValues ...any) {
z.panicW(z.sugar, message, keyAndValues...)
}
// Fatal uses fmt.Sprint to construct and log a message, then calls os.Exit
func (z *Zap) Fatal(args ...any) {
z.fatal(z.sugar, args...)
}
// FatalF uses fmt.Sprintf to log a templated message, then calls os.Exit
func (z *Zap) FatalF(message string, args ...any) {
z.fatalF(z.sugar, message, args...)
}
// FatalW logs a message with some additional context, then calls os.Exit. The
// variadic key-value pairs are treated as they are in With
func (z *Zap) FatalW(message string, keyAndValues ...any) {
z.fatalW(z.sugar, message, keyAndValues...)
}