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:
Daniel Liu 2024-11-15 10:02:42 +08:00
parent dce80d77b7
commit ed4f989ff3

View file

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