From 4fd0a7672777f0ed15692ae2ba47838208537558 Mon Sep 17 00:00:00 2001 From: Wim Date: Sun, 27 Nov 2022 00:42:16 +0100 Subject: Update dependencies (#1929) --- vendor/github.com/labstack/gommon/log/log.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'vendor/github.com/labstack/gommon/log/log.go') diff --git a/vendor/github.com/labstack/gommon/log/log.go b/vendor/github.com/labstack/gommon/log/log.go index 06fa37e0..25f719aa 100644 --- a/vendor/github.com/labstack/gommon/log/log.go +++ b/vendor/github.com/labstack/gommon/log/log.go @@ -391,7 +391,7 @@ func (l *Logger) log(level Lvl, format string, args ...interface{}) { if err == nil { s := buf.String() i := buf.Len() - 1 - if s[i] == '}' { + if i >= 0 && s[i] == '}' { // JSON header buf.Truncate(i) buf.WriteByte(',') @@ -404,7 +404,9 @@ func (l *Logger) log(level Lvl, format string, args ...interface{}) { } } else { // Text header - buf.WriteByte(' ') + if len(s) > 0 { + buf.WriteByte(' ') + } buf.WriteString(message) } buf.WriteByte('\n') -- cgit v1.2.3