diff --git a/log/log.go b/log/log.go index 371f601..7317a5f 100644 --- a/log/log.go +++ b/log/log.go @@ -209,7 +209,7 @@ func (l *Logger) Output(callDepth int, level int, format string, v ...interface{ buf = append(buf, s...) - if s[len(s)-1] != '\n' { + if len(s) == 0 || s[len(s)-1] != '\n' { buf = append(buf, '\n') }