From 8327692e9f6c5a3d18db2cb42b155b3e0c75d8d7 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 9 Mar 2022 10:16:03 -0800 Subject: [PATCH] Filters out CR (`\r`) characters from log messages --- logger.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/logger.go b/logger.go index 467d7ace..cbe83594 100644 --- a/logger.go +++ b/logger.go @@ -14,5 +14,7 @@ func (l DebugLogger) Log(args ...interface{}) { tokens = append(tokens, token) } } - log.Printf("[DEBUG] [aws-sdk-go] %s", strings.Join(tokens, " ")) + s := strings.Join(tokens, " ") + s = strings.ReplaceAll(s, "\r", "") // Works around https://github.com/jen20/teamcity-go-test/pull/2 + log.Printf("[DEBUG] [aws-sdk-go] %s", s) }