refactor: simplify the code (#2763)
* refactor: simplify the code * fix: fix data race * refactor: simplify the code * refactor: simplify the code
This commit is contained in:
@@ -269,7 +269,10 @@ func combineGlobalFields(fields []LogField) []LogField {
|
||||
return fields
|
||||
}
|
||||
|
||||
return append(globals.([]LogField), fields...)
|
||||
originLogFields := globals.([]LogField)
|
||||
logFields := append(make([]LogField, 0, len(originLogFields)+len(fields)), originLogFields...)
|
||||
|
||||
return append(logFields, fields...)
|
||||
}
|
||||
|
||||
func output(writer io.Writer, level string, val interface{}, fields ...LogField) {
|
||||
|
||||
Reference in New Issue
Block a user