chore: refactor func name (#2804)

* chore: refactor func name

* chore: make plain log clearer
master
Kevin Wan 2 years ago committed by GitHub
parent ba0dff2d61
commit 32a59dbc27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -253,11 +253,11 @@ func (n nopWriter) Stack(_ interface{}) {
func (n nopWriter) Stat(_ interface{}, _ ...LogField) {
}
func buildFields(fields ...LogField) []string {
func buildPlainFields(fields ...LogField) []string {
var items []string
for _, field := range fields {
items = append(items, fmt.Sprintf("%s=%v", field.Key, field.Value))
items = append(items, fmt.Sprintf("%s=%+v", field.Key, field.Value))
}
return items
@ -291,7 +291,7 @@ func output(writer io.Writer, level string, val interface{}, fields ...LogField)
switch atomic.LoadUint32(&encoding) {
case plainEncodingType:
writePlainAny(writer, level, val, buildFields(fields...)...)
writePlainAny(writer, level, val, buildPlainFields(fields...)...)
default:
entry := make(logEntry)
for _, field := range fields {

Loading…
Cancel
Save