aboutsummaryrefslogtreecommitdiffstats
path: root/log/format.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-04-05 06:16:29 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-04-05 06:16:29 +0800
commit09777952ee476ff80d4b6e63b5041ff5ca0e441b (patch)
treee85320f88f548201e3476b3e7095e96fd071617b /log/format.go
parente50a5b77712d891ff409aa942a5cbc24e721b332 (diff)
downloaddexon-09777952ee476ff80d4b6e63b5041ff5ca0e441b.tar.gz
dexon-09777952ee476ff80d4b6e63b5041ff5ca0e441b.tar.zst
dexon-09777952ee476ff80d4b6e63b5041ff5ca0e441b.zip
core, consensus: pluggable consensus engines (#3817)
This commit adds pluggable consensus engines to go-ethereum. In short, it introduces a generic consensus interface, and refactors the entire codebase to use this interface.
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()