platform: Fix output format

This commit is contained in:
世界 2023-07-09 12:24:43 +08:00
parent e929dde13e
commit bb651db2d2
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -78,7 +78,7 @@ func (f Formatter) Format(ctx context.Context, level Level, tag string, message
message = levelString + "[" + xd(int(timestamp.Sub(f.BaseTime)/time.Second), 4) + "] " + message
}
if f.DisableLineBreak {
if message[len(message)-1] != '\n' {
if message[len(message)-1] == '\n' {
message = message[:len(message)-1]
}
} else {