mirror of https://github.com/go-gorm/gorm.git
Better log output int8, int, int16, int32, int64, float32, float64, bool. (#2258)
* Better log output int, int16, int32, int64, int8, float32, float64. * Better log output bool
This commit is contained in:
parent
9f1a7f5351
commit
8494ecdc98
|
@ -63,8 +63,14 @@ var LogFormatter = func(values ...interface{}) (messages []interface{}) {
|
||||||
formattedValues = append(formattedValues, "NULL")
|
formattedValues = append(formattedValues, "NULL")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
switch value.(type) {
|
||||||
|
case int8, int, int16, int32, int64, float32, float64, bool:
|
||||||
|
formattedValues = append(formattedValues, fmt.Sprintf("%v", value))
|
||||||
|
break
|
||||||
|
default:
|
||||||
formattedValues = append(formattedValues, fmt.Sprintf("'%v'", value))
|
formattedValues = append(formattedValues, fmt.Sprintf("'%v'", value))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
formattedValues = append(formattedValues, "NULL")
|
formattedValues = append(formattedValues, "NULL")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue