From f3b10bb0ebfd091cb2c1a3a8d35507164935da2a Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Tue, 7 Feb 2023 15:38:47 +0100 Subject: [PATCH 1/2] log: allow tabs in log messages This fixes a regression where panic reports in RPC handlers were quoted because they contain tab characters. --- log/format.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/log/format.go b/log/format.go index 42525ea6d296..538afd81c919 100644 --- a/log/format.go +++ b/log/format.go @@ -493,7 +493,7 @@ func escapeMessage(s string) string { needsQuoting := false for _, r := range s { // Carriage return and Line feed are ok - if r == 0xa || r == 0xd { + if r == '\r' || r == '\n' || r == '\t' { continue } // We quote everything below (0x20) and above~ (0x7E), From a9073178640f50e8fde98979ac32dc154967c805 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Tue, 7 Feb 2023 19:52:43 +0100 Subject: [PATCH 2/2] Update format.go --- log/format.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/log/format.go b/log/format.go index 538afd81c919..d7e2f820afe7 100644 --- a/log/format.go +++ b/log/format.go @@ -492,7 +492,7 @@ func escapeString(s string) string { func escapeMessage(s string) string { needsQuoting := false for _, r := range s { - // Carriage return and Line feed are ok + // Allow CR/LF/TAB. This is to make multi-line messages work. if r == '\r' || r == '\n' || r == '\t' { continue }