mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-23 09:00:20 +08:00
chore: refactor func name (#2804)
* chore: refactor func name * chore: make plain log clearer
This commit is contained in:
parent
ba0dff2d61
commit
32a59dbc27
@ -253,11 +253,11 @@ func (n nopWriter) Stack(_ interface{}) {
|
|||||||
func (n nopWriter) Stat(_ interface{}, _ ...LogField) {
|
func (n nopWriter) Stat(_ interface{}, _ ...LogField) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func buildFields(fields ...LogField) []string {
|
func buildPlainFields(fields ...LogField) []string {
|
||||||
var items []string
|
var items []string
|
||||||
|
|
||||||
for _, field := range fields {
|
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
|
return items
|
||||||
@ -291,7 +291,7 @@ func output(writer io.Writer, level string, val interface{}, fields ...LogField)
|
|||||||
|
|
||||||
switch atomic.LoadUint32(&encoding) {
|
switch atomic.LoadUint32(&encoding) {
|
||||||
case plainEncodingType:
|
case plainEncodingType:
|
||||||
writePlainAny(writer, level, val, buildFields(fields...)...)
|
writePlainAny(writer, level, val, buildPlainFields(fields...)...)
|
||||||
default:
|
default:
|
||||||
entry := make(logEntry)
|
entry := make(logEntry)
|
||||||
for _, field := range fields {
|
for _, field := range fields {
|
||||||
|
Loading…
Reference in New Issue
Block a user