Unverified Commit 8c18b48b authored by Felix Lange's avatar Felix Lange Committed by GitHub

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
parent 00a9b80b
...@@ -492,8 +492,8 @@ func escapeString(s string) string { ...@@ -492,8 +492,8 @@ func escapeString(s string) string {
func escapeMessage(s string) string { func escapeMessage(s string) string {
needsQuoting := false needsQuoting := false
for _, r := range s { 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 == 0xa || r == 0xd { if r == '\r' || r == '\n' || r == '\t' {
continue continue
} }
// We quote everything below <space> (0x20) and above~ (0x7E), // We quote everything below <space> (0x20) and above~ (0x7E),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment