Merge branch 'master' of github.com:bilibili/Kratos

pull/91/head
felixhao 6 years ago
commit 5a4ded5198
  1. 2
      pkg/log/field.go
  2. 4
      pkg/log/internal/core/field.go
  3. 2
      pkg/log/util.go

@ -18,7 +18,7 @@ func KVString(key string, value string) D {
// KVInt construct Field with int value.
func KVInt(key string, value int) D {
return D{Key: key, Type: core.IntTpye, Int64Val: int64(value)}
return D{Key: key, Type: core.IntType, Int64Val: int64(value)}
}
// KVInt64 construct D with int64 value.

@ -15,7 +15,7 @@ type FieldType int32
const (
UnknownType FieldType = iota
StringType
IntTpye
IntType
Int64Type
UintType
Uint64Type
@ -43,7 +43,7 @@ func (f Field) AddTo(enc ObjectEncoder) {
switch f.Type {
case StringType:
enc.AddString(f.Key, f.StringVal)
case IntTpye:
case IntType:
enc.AddInt(f.Key, int(f.Int64Val))
case Int64Type:
enc.AddInt64(f.Key, f.Int64Val)

@ -45,7 +45,7 @@ func toMap(args ...D) map[string]interface{} {
d := make(map[string]interface{}, 10+len(args))
for _, arg := range args {
switch arg.Type {
case core.UintType, core.Uint64Type, core.IntTpye, core.Int64Type:
case core.UintType, core.Uint64Type, core.IntType, core.Int64Type:
d[arg.Key] = arg.Int64Val
case core.StringType:
d[arg.Key] = arg.StringVal

Loading…
Cancel
Save