From cdde508ef1d64f278ccc0dccc46f798398ae44ac Mon Sep 17 00:00:00 2001 From: Jared Wasinger Date: Wed, 15 Nov 2023 16:34:50 +0800 Subject: [PATCH] FormatLogfmtValue should escape error and fmt.Stringer values --- log/format.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/log/format.go b/log/format.go index cdb884ce9d..fb9e3955ed 100644 --- a/log/format.go +++ b/log/format.go @@ -169,9 +169,9 @@ func FormatLogfmtValue(value interface{}, term bool) (result string) { } switch v := value.(type) { case error: - return v.Error() + return escapeString(v.Error()) case fmt.Stringer: - return v.String() + return escapeString(v.String()) case bool: return strconv.FormatBool(v) case float32: