From 69dd8c4eea4d88ab41ce61aa1cb2d0a71c3e9f2e Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Thu, 22 Feb 2024 09:04:02 +0300 Subject: [PATCH] fixup fields again Signed-off-by: Vasiliy Tolstov --- logger.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/logger.go b/logger.go index 5bd5a27..c282c85 100644 --- a/logger.go +++ b/logger.go @@ -30,9 +30,9 @@ func (l *mlogger) Log(lvl kgo.LogLevel, msg string, args ...interface{}) { return } 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 { - 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) } else {