aboutsummaryrefslogtreecommitdiffstats
path: root/log/format.go
diff options
context:
space:
mode:
Diffstat (limited to 'log/format.go')
-rw-r--r--log/format.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/log/format.go b/log/format.go
index e315b5237..6c19c7a55 100644
--- a/log/format.go
+++ b/log/format.go
@@ -133,10 +133,10 @@ func TerminalFormat(usecolor bool) Format {
}
}
// try to justify the log output for short messages
- if len(r.Ctx) > 0 && len(r.Msg) < termMsgJust {
- b.Write(bytes.Repeat([]byte{' '}, termMsgJust-len(r.Msg)))
+ length := utf8.RuneCountInString(r.Msg)
+ if len(r.Ctx) > 0 && length < termMsgJust {
+ b.Write(bytes.Repeat([]byte{' '}, termMsgJust-length))
}
-
// print the keys logfmt style
logfmt(b, r.Ctx, color, true)
return b.Bytes()