Better log output int, int16, int32, int64, int8, float32, float64.

This commit is contained in:
axx 2019-01-11 20:06:02 +08:00
parent 9f1a7f5351
commit e3aaf360a6

View File

@ -63,7 +63,13 @@ var LogFormatter = func(values ...interface{}) (messages []interface{}) {
formattedValues = append(formattedValues, "NULL") formattedValues = append(formattedValues, "NULL")
} }
} else { } else {
formattedValues = append(formattedValues, fmt.Sprintf("'%v'", value)) switch value.(type) {
case int, int16, int32, int64, int8, float32, float64:
formattedValues = append(formattedValues, fmt.Sprintf("%v", value))
break
default:
formattedValues = append(formattedValues, fmt.Sprintf("'%v'", value))
}
} }
} else { } else {
formattedValues = append(formattedValues, "NULL") formattedValues = append(formattedValues, "NULL")