From c4e75c05d335c6c6a4eec6a471505edd11b99d5c Mon Sep 17 00:00:00 2001 From: Achim Rohn Date: Thu, 15 Jan 2026 22:58:41 +0100 Subject: [PATCH] Fix variadic parameter handling in logger functions for consistency and correctness --- logger.go | 10 +++++----- open_telemetry_logger.go | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/logger.go b/logger.go index 2b44ff8..66f24a4 100644 --- a/logger.go +++ b/logger.go @@ -21,10 +21,10 @@ func PrintLogDebug(message string, a ...any) { func Debug(a ...any) { if ErstellerLogger == nil { - PrintDebug(a) + PrintDebug(a...) return } - ErstellerLogger.Debug(a) + ErstellerLogger.Debug(a...) } func PrintDebug(a ...any) { @@ -56,12 +56,12 @@ func PrintLogError(message string, a []any) { func Error(a ...any) { if ErstellerLogger == nil { - PrintError(a) + PrintError(a...) return } - ErstellerLogger.Error(a) + ErstellerLogger.Error(a...) } -func PrintError(a []any) { +func PrintError(a ...any) { println(fmt.Sprint("Error: ", joinStrings(a))) } diff --git a/open_telemetry_logger.go b/open_telemetry_logger.go index 8794219..c00acd5 100644 --- a/open_telemetry_logger.go +++ b/open_telemetry_logger.go @@ -77,7 +77,7 @@ func (l *LoggerImpl) Debug(a ...any) { return } if l.logToStdout { - PrintDebug(a) + PrintDebug(a...) } // Use OpenTelemetry logger @@ -103,7 +103,7 @@ func (l *LoggerImpl) Error(a ...any) { } if l.logToStdout { - PrintError(a) + PrintError(a...) } // Use OpenTelemetry logger