refactor(raft): use decimal format to print number in raft log.

Signed-off-by: Victor1319 <zengxuewei@oppo.com>
This commit is contained in:
Victor1319 2024-10-12 15:07:20 +08:00 committed by chihe
parent 3e43d5020b
commit 865dbdfa61
2 changed files with 2 additions and 2 deletions

View File

@ -263,7 +263,7 @@ func (r *raftFsm) Step(m *proto.Message) {
// term.
default:
if logger.IsEnableDebug() {
logger.Debug("[raft->Step][%d,%d] [term: %d] received a %s message with higher term from %d [term: %d]",
logger.Debug("[raft->Step][%d,%s] [term: %d] received a %s message with higher term from %d [term: %d]",
r.id, r.config.ReplicateAddr, r.term, m.Type, m.From, m.Term)
}
if m.Type == proto.ReqMsgAppend || m.Type == proto.ReqMsgHeartBeat || m.Type == proto.ReqMsgSnapShot {

View File

@ -35,7 +35,7 @@ func (r *raftFsm) becomeCandidate() {
r.vote = r.config.NodeID
r.state = stateCandidate
if logger.IsEnableDebug() {
logger.Debug("raft[%v] became candidate at term %d.", r.id, r.config.TransportConfig.ReplicateAddr, r.term)
logger.Debug("raft[%v] %s became candidate at term %d.", r.id, r.config.TransportConfig.ReplicateAddr, r.term)
}
}