mirror of https://github.com/siddontang/go.git
fix log crash when print empty string
This commit is contained in:
parent
bdc77568d7
commit
5a78094b6f
|
@ -209,7 +209,7 @@ func (l *Logger) Output(callDepth int, level int, format string, v ...interface{
|
||||||
|
|
||||||
buf = append(buf, s...)
|
buf = append(buf, s...)
|
||||||
|
|
||||||
if s[len(s)-1] != '\n' {
|
if len(s) == 0 || s[len(s)-1] != '\n' {
|
||||||
buf = append(buf, '\n')
|
buf = append(buf, '\n')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue