From 8c18b48bf15f19a702d823fe50205dca58fc83a9 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 8 Feb 2023 10:39:17 +0100 Subject: [PATCH] log: allow tabs in log messages (#26630) * log: allow tabs in log messages This fixes a regression where panic reports in RPC handlers were quoted because they contain tab characters. * Update format.go --- log/format.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/log/format.go b/log/format.go index 42525ea6d2..d7e2f820af 100644 --- a/log/format.go +++ b/log/format.go @@ -492,8 +492,8 @@ func escapeString(s string) string { func escapeMessage(s string) string { needsQuoting := false for _, r := range s { - // Carriage return and Line feed are ok - if r == 0xa || r == 0xd { + // Allow CR/LF/TAB. This is to make multi-line messages work. + if r == '\r' || r == '\n' || r == '\t' { continue } // We quote everything below (0x20) and above~ (0x7E),