-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.go
174 lines (145 loc) · 3.25 KB
/
types.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
package log
import (
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
const (
// ContextLoggerName is logger key from context.Context.
ContextLoggerName = "contextLgger"
)
type (
// Field ...
Field = zapcore.Field
// Level ...
Level = zapcore.Level
// Entry ...
Entry = zapcore.Entry
// Hook ...
Hook = func(entry Entry) error
)
// Alias for zap level.
var (
DebugLevel = zapcore.DebugLevel
InfoLevel = zapcore.InfoLevel
WarnLevel = zapcore.WarnLevel
ErrorLevel = zapcore.ErrorLevel
DPanicLevel = zapcore.DPanicLevel
PanicLevel = zapcore.PanicLevel
FatalLevel = zapcore.FatalLevel
)
// Alias for zap type functions.
var (
Any = zap.Any
Array = zap.Array
Object = zap.Object
Binary = zap.Binary
Bool = zap.Bool
Bools = zap.Bools
ByteString = zap.ByteString
ByteStrings = zap.ByteStrings
Complex64 = zap.Complex64
Complex64s = zap.Complex64s
Complex128 = zap.Complex128
Complex128s = zap.Complex128s
Duration = zap.Duration
Durations = zap.Durations
Err = zap.Error
Errors = zap.Errors
Float32 = zap.Float32
Float32s = zap.Float32s
Float64 = zap.Float64
Float64s = zap.Float64s
Int = zap.Int
Ints = zap.Ints
Int8 = zap.Int8
Int8s = zap.Int8s
Int16 = zap.Int16
Int16s = zap.Int16s
Int32 = zap.Int32
Int32s = zap.Int32s
Int64 = zap.Int64
Int64s = zap.Int64s
Namespace = zap.Namespace
Reflect = zap.Reflect
Stack = zap.Stack
String = zap.String
Stringer = zap.Stringer
Strings = zap.Strings
Time = zap.Time
Times = zap.Times
Uint = zap.Uint
Uints = zap.Uints
Uint8 = zap.Uint8
Uint8s = zap.Uint8s
Uint16 = zap.Uint16
Uint16s = zap.Uint16s
Uint32 = zap.Uint32
Uint32s = zap.Uint32s
Uint64 = zap.Uint64
Uint64s = zap.Uint64s
Uintptr = zap.Uintptr
Uintptrs = zap.Uintptrs
)
// User can directly use package level functions
var (
Debug = std.Debug
Debugf = std.Debugf
Debugw = std.Debugw
Info = std.Info
Infof = std.Infof
Infow = std.Infow
Warn = std.Warn
Warnf = std.Warnf
Warnw = std.Warnw
Error = std.Error
Errorf = std.Errorf
Errorw = std.Errorw
DPanic = std.DPanic
DPanicf = std.DPanicf
DPanicw = std.DPanicw
Panic = std.Panic
Panicf = std.Panicf
Panicw = std.Panicw
Fatal = std.Fatal
Fatalf = std.Fatalf
Fatalw = std.Fatalw
Sync = std.Sync
WithName = std.WithName
WithFields = std.WithFields
WithHooks = std.WithHooks
ToContext = std.ToContext
FromContext = std.FromContext
GetOptions = std.GetOptions
C = std.C
)
func resetDefaultLogger() {
Debug = std.Debug
Debugf = std.Debugf
Debugw = std.Debugw
Info = std.Info
Infof = std.Infof
Infow = std.Infow
Warn = std.Warn
Warnf = std.Warnf
Warnw = std.Warnw
Error = std.Error
Errorf = std.Errorf
Errorw = std.Errorw
DPanic = std.DPanic
DPanicf = std.DPanicf
DPanicw = std.DPanicw
Panic = std.Panic
Panicf = std.Panicf
Panicw = std.Panicw
Fatal = std.Fatal
Fatalf = std.Fatalf
Fatalw = std.Fatalw
Sync = std.Sync
WithName = std.WithName
WithFields = std.WithFields
WithHooks = std.WithHooks
ToContext = std.ToContext
FromContext = std.FromContext
GetOptions = std.GetOptions
C = std.C
}