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
This commit is contained in:
Felix Lange 2023-02-08 10:39:17 +01:00 committed by GitHub
parent 00a9b80b5c
commit 8c18b48bf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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 <space> (0x20) and above~ (0x7E),