diff options
author | Wim <wim@42.be> | 2022-11-27 00:42:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-27 00:42:16 +0100 |
commit | 4fd0a7672777f0ed15692ae2ba47838208537558 (patch) | |
tree | b119834a8b9ee78aa8f1b2ad05efa7da50516cbf /vendor/github.com/labstack/gommon/log/log.go | |
parent | 6da9d567dc9195e9a5211f23a6795a41f56a1bfc (diff) | |
download | matterbridge-msglm-4fd0a7672777f0ed15692ae2ba47838208537558.tar.gz matterbridge-msglm-4fd0a7672777f0ed15692ae2ba47838208537558.tar.bz2 matterbridge-msglm-4fd0a7672777f0ed15692ae2ba47838208537558.zip |
Update dependencies (#1929)
Diffstat (limited to 'vendor/github.com/labstack/gommon/log/log.go')
-rw-r--r-- | vendor/github.com/labstack/gommon/log/log.go | 6 |
1 files changed, 4 insertions, 2 deletions
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') |