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
pull/26641/head
Felix Lange 2 years ago committed by GitHub
parent 00a9b80b5c
commit 8c18b48bf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      log/format.go

@ -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),

Loading…
Cancel
Save