mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Only use the EntryFormatter for normal entries.
ConfChange entries also have a Data field but the application-supplied formatter won't know what to do with them.
This commit is contained in:
parent
0ea2173a7e
commit
b53dc0826e
@ -84,10 +84,10 @@ func DescribeMessage(m pb.Message, f EntryFormatter) string {
|
||||
// Entry for debugging.
|
||||
func DescribeEntry(e pb.Entry, f EntryFormatter) string {
|
||||
var formatted string
|
||||
if f == nil {
|
||||
formatted = fmt.Sprintf("%q", e.Data)
|
||||
} else {
|
||||
if e.Type == pb.EntryNormal && f != nil {
|
||||
formatted = f(e.Data)
|
||||
} else {
|
||||
formatted = fmt.Sprintf("%q", e.Data)
|
||||
}
|
||||
return fmt.Sprintf("%d/%d %s %s", e.Term, e.Index, e.Type, formatted)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user