-
Notifications
You must be signed in to change notification settings - Fork 0
/
alias.go
93 lines (87 loc) · 2.19 KB
/
alias.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
package log
import (
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
var (
Skip = zap.Skip
Binary = zap.Binary
Bool = zap.Bool
Boolp = zap.Boolp
ByteString = zap.ByteString
Complex128 = zap.Complex128
Complex128p = zap.Complex128p
Complex64 = zap.Complex64
Complex64p = zap.Complex64p
Float64 = zap.Float64
Float64p = zap.Float64p
Float32 = zap.Float32
Float32p = zap.Float32p
Int = zap.Int
Intp = zap.Intp
Int64 = zap.Int64
Int64p = zap.Int64p
Int32 = zap.Int32
Int32p = zap.Int32p
Int16 = zap.Int16
Int16p = zap.Int16p
Int8 = zap.Int8
Int8p = zap.Int8p
String = zap.String
Stringp = zap.Stringp
Uint = zap.Uint
Uintp = zap.Uintp
Uint64 = zap.Uint64
Uint64p = zap.Uint64p
Uint32 = zap.Uint32
Uint32p = zap.Uint32p
Uint16 = zap.Uint16
Uint16p = zap.Uint16p
Uint8 = zap.Uint8
Uint8p = zap.Uint8p
Uintptr = zap.Uintptr
Uintptrp = zap.Uintptrp
Reflect = zap.Reflect
Namespace = zap.Namespace
Stringer = zap.Stringer
Time = zap.Time
Timep = zap.Timep
Stack = zap.Stack
StackSkip = zap.StackSkip
Duration = zap.Duration
Durationp = zap.Durationp
Object = zap.Object
Inline = zap.Inline
Any = zap.Any
// array alias
Array = zap.Array
Bools = zap.Bools
ByteStrings = zap.ByteStrings
Complex128s = zap.Complex128s
Complex64s = zap.Complex64s
Durations = zap.Durations
Float64s = zap.Float64s
Float32s = zap.Float32s
Ints = zap.Ints
Int64s = zap.Int64s
Int32s = zap.Int32s
Int16s = zap.Int16s
Int8s = zap.Int8s
Strings = zap.Strings
Times = zap.Times
Uints = zap.Uints
Uint64s = zap.Uint64s
Uint32s = zap.Uint32s
Uint16s = zap.Uint16s
Uint8s = zap.Uint8s
Uintptrs = zap.Uintptrs
Errors = zap.Errors
ErrorField = zap.Error
NamedError = zap.NamedError
)
func ErrorStr(err error) zap.Field {
if err == nil {
return zap.Field{Key: "error", Type: zapcore.StringType, String: ""}
}
return zap.Field{Key: "error", Type: zapcore.StringType, String: err.Error()}
}