fixup fields again
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
27a6a923cd
commit
69dd8c4eea
@ -30,9 +30,9 @@ func (l *mlogger) Log(lvl kgo.LogLevel, msg string, args ...interface{}) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if len(args) > 0 {
|
if len(args) > 0 {
|
||||||
fields := make(map[string]interface{}, int(len(args)/2))
|
fields := make([]interface{}, 0, len(args))
|
||||||
for i := 0; i <= len(args)/2; i += 2 {
|
for i := 0; i <= len(args)/2; i += 2 {
|
||||||
fields[fmt.Sprintf("%v", args[i])] = args[i+1]
|
fields = append(fields, fmt.Sprintf("%v", args[i]), args[i+1])
|
||||||
}
|
}
|
||||||
l.l.Fields(fields).Log(l.ctx, mlvl, msg)
|
l.l.Fields(fields).Log(l.ctx, mlvl, msg)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user