raft: drop the raft prefix in logging

This commit is contained in:
Xiang Li
2015-06-01 15:06:38 -07:00
parent 3af4a45d7b
commit 1561b85bf3
4 changed files with 43 additions and 43 deletions

View File

@@ -106,7 +106,7 @@ func (u *unstable) truncateAndAppend(ents []pb.Entry) {
// directly append
u.entries = append(u.entries, ents...)
case after < u.offset:
raftLogger.Infof("raftlog: replace the unstable entries from index %d", after+1)
raftLogger.Infof("replace the unstable entries from index %d", after+1)
// The log is being truncated to before our current offset
// portion, so set the offset and replace the entries
u.offset = after + 1
@@ -114,7 +114,7 @@ func (u *unstable) truncateAndAppend(ents []pb.Entry) {
default:
// truncate to after and copy to u.entries
// then append
raftLogger.Infof("raftlog: truncate the unstable entries to index %d", after)
raftLogger.Infof("truncate the unstable entries to index %d", after)
u.entries = append([]pb.Entry{}, u.slice(u.offset, after+1)...)
u.entries = append(u.entries, ents...)
}
@@ -128,10 +128,10 @@ func (u *unstable) slice(lo uint64, hi uint64) []pb.Entry {
// u.offset <= lo <= hi <= u.offset+len(u.offset)
func (u *unstable) mustCheckOutOfBounds(lo, hi uint64) {
if lo > hi {
raftLogger.Panicf("raft: invalid unstable.slice %d > %d", lo, hi)
raftLogger.Panicf("invalid unstable.slice %d > %d", lo, hi)
}
upper := u.offset + uint64(len(u.entries))
if lo < u.offset || hi > upper {
raftLogger.Panicf("raft: unstable.slice[%d,%d) out of bound [%d,%d]", lo, hi, u.offset, upper)
raftLogger.Panicf("unstable.slice[%d,%d) out of bound [%d,%d]", lo, hi, u.offset, upper)
}
}