task#560 print leaf k/v with right value

pull/24/head
stone1342006 2016-05-18 22:56:05 +08:00
parent c1c3bd7e84
commit 60fbb2c9fa
1 changed files with 2 additions and 2 deletions

View File

@ -539,9 +539,9 @@ func (cmd *PageCommand) PrintLeaf(w io.Writer, buf []byte) error {
b := (*bucket)(unsafe.Pointer(&e.value()[0]))
v = fmt.Sprintf("<pgid=%d,seq=%d>", b.root, b.sequence)
} else if isPrintable(string(e.value())) {
k = fmt.Sprintf("%q", string(e.value()))
v = fmt.Sprintf("%q", string(e.value()))
} else {
k = fmt.Sprintf("%x", string(e.value()))
v = fmt.Sprintf("%x", string(e.value()))
}
fmt.Fprintf(w, "%s: %s\n", k, v)