From 8d55a3025f0e879955ab4efc40ef9ed9c38489b2 Mon Sep 17 00:00:00 2001 From: Koptelov Nikita Date: Fri, 29 Oct 2021 12:39:22 +0300 Subject: [PATCH] logger: fix debug logs' formatting directives Default DebugLogger had broken Printf directives - for DebugLogger.Printf(fmt,A,B,C) it called Logger.Printf(fmt,[A B C]), which resulted in logs like ``` client/coordinator coordinator for consumergroup [topicname %!s(int32=1) host:9094] is #%!d(MISSING) (%!s(MISSING)) ``` This commit fixes value passing for Printf. --- sarama.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sarama.go b/sarama.go index f6e55a395..963515a73 100644 --- a/sarama.go +++ b/sarama.go @@ -116,13 +116,13 @@ type StdLogger interface { type debugLogger struct{} func (d *debugLogger) Print(v ...interface{}) { - Logger.Print(v) + Logger.Print(v...) } func (d *debugLogger) Printf(format string, v ...interface{}) { - Logger.Printf(format, v) + Logger.Printf(format, v...) } func (d *debugLogger) Println(v ...interface{}) { - Logger.Println(v) + Logger.Println(v...) } // DebugLogger is the instance of a StdLogger that Sarama writes more verbose