Skip to content

Commit cfc14d6

Browse files
fjlshekhirin
authored andcommitted
log: allow tabs in log messages (ethereum#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
1 parent 15d3042 commit cfc14d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

log/format.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,8 @@ func escapeString(s string) string {
492492
func escapeMessage(s string) string {
493493
needsQuoting := false
494494
for _, r := range s {
495-
// Carriage return and Line feed are ok
496-
if r == 0xa || r == 0xd {
495+
// Allow CR/LF/TAB. This is to make multi-line messages work.
496+
if r == '\r' || r == '\n' || r == '\t' {
497497
continue
498498
}
499499
// We quote everything below <space> (0x20) and above~ (0x7E),

0 commit comments

Comments
 (0)