github.com/godaddy-x/freego@v1.0.156/zlog/zlog_field.go (about) 1 package zlog 2 3 import ( 4 "fmt" 5 "go.uber.org/zap" 6 "go.uber.org/zap/zapcore" 7 "time" 8 ) 9 10 func Skip() zap.Field { 11 return zap.Skip() 12 } 13 14 func Binary(key string, val []byte) zap.Field { 15 return zap.Binary(key, val) 16 } 17 18 func Bool(key string, val bool) zap.Field { 19 return zap.Bool(key, val) 20 } 21 22 func ByteString(key string, val []byte) zap.Field { 23 return zap.ByteString(key, val) 24 } 25 26 func Complex128(key string, val complex128) zap.Field { 27 return zap.Complex128(key, val) 28 } 29 30 func Complex64(key string, val complex64) zap.Field { 31 return zap.Complex64(key, val) 32 } 33 34 func Float64(key string, val float64) zap.Field { 35 return zap.Float64(key, val) 36 } 37 38 func Float32(key string, val float32) zap.Field { 39 return zap.Float32(key, val) 40 } 41 42 func Int(key string, val int) zap.Field { 43 return zap.Int(key, val) 44 } 45 46 func Int64(key string, val int64) zap.Field { 47 return zap.Int64(key, val) 48 } 49 50 func Int32(key string, val int32) zap.Field { 51 return zap.Int32(key, val) 52 } 53 54 func Int16(key string, val int16) zap.Field { 55 return zap.Int16(key, val) 56 } 57 58 func Int8(key string, val int8) zap.Field { 59 return zap.Int8(key, val) 60 } 61 62 func String(key string, val string) zap.Field { 63 return zap.String(key, val) 64 } 65 66 func Uint(key string, val uint) zap.Field { 67 return zap.Uint(key, val) 68 } 69 70 func Uint64(key string, val uint64) zap.Field { 71 return zap.Uint64(key, val) 72 } 73 74 func Uint32(key string, val uint32) zap.Field { 75 return zap.Uint32(key, val) 76 } 77 78 func Uint16(key string, val uint16) zap.Field { 79 return zap.Uint16(key, val) 80 } 81 82 func Uint8(key string, val uint8) zap.Field { 83 return zap.Uint8(key, val) 84 } 85 86 func Uintptr(key string, val uintptr) zap.Field { 87 return zap.Uintptr(key, val) 88 } 89 90 func Reflect(key string, val interface{}) zap.Field { 91 return zap.Reflect(key, val) 92 } 93 94 func Namespace(key string) zap.Field { 95 return zap.Namespace(key) 96 } 97 98 func Stringer(key string, val fmt.Stringer) zap.Field { 99 return zap.Stringer(key, val) 100 } 101 102 func Time(key string, val time.Time) zap.Field { 103 return zap.Time(key, val) 104 } 105 106 func Stack(key string) zap.Field { 107 return zap.Stack(key) 108 } 109 110 func Duration(key string, val time.Duration) zap.Field { 111 return zap.Duration(key, val) 112 } 113 114 func Object(key string, val zapcore.ObjectMarshaler) zap.Field { 115 return zap.Object(key, val) 116 } 117 118 func Any(key string, value interface{}) zap.Field { 119 return zap.Any(key, value) 120 }