diff --git a/pkg/util/log/log_entry.go b/pkg/util/log/log_entry.go index e777241e2d73..e594f8cf23ea 100644 --- a/pkg/util/log/log_entry.go +++ b/pkg/util/log/log_entry.go @@ -97,7 +97,10 @@ func (e *logEntry) SafeFormat(w interfaces.SafePrinter, _ rune) { // with a colon between the line number and the message. // However, some location filter deep inside SQL doesn't // understand a colon after the line number. - w.Printf("%s:%d ", redact.Safe(e.file), redact.Safe(e.line)) + w.SafeString(redact.SafeString(e.file)) + w.SafeRune(':') + w.SafeInt(redact.SafeInt(e.line)) + w.SafeRune(' ') } if e.tags != nil { w.SafeString("[") @@ -110,10 +113,10 @@ func (e *logEntry) SafeFormat(w interfaces.SafePrinter, _ rune) { // that the format strings for `log.Infof` etc are const strings. k := redact.SafeString(tag.Key()) v := tag.Value() + w.SafeString(k) if v != nil { - w.Printf("%s=%v", k, tag.Value()) - } else { - w.Printf("%s", k) + w.SafeRune('=') + w.Print(tag.Value()) } } w.SafeString("] ")