change log message

This commit is contained in:
Masato Imai
2025-02-25 06:49:32 +00:00
parent 54ee80fbfd
commit 5c7f26c6be

View File

@ -39,6 +39,8 @@ impl Peer {
}
async fn handle_event(&mut self, event: Event) {
let current_state = self.state.clone();
match &self.state {
State::Idle => match event {
Event::ManualStart => {
@ -48,7 +50,6 @@ impl Peer {
} else {
panic!("cannot establish TCP connection: {:?}", self.config);
}
info!("state transitioned from Idle to Connect");
self.state = State::Connect;
}
_ => {}
@ -63,13 +64,19 @@ impl Peer {
self.config.local_ip,
))
.await;
info!("state transitioned from Connect to OpenSent");
self.state = State::OpenSent;
}
_ => {}
},
_ => {}
}
if self.state != current_state {
info!(
"state transitioned, from={:?}, to={:?}",
current_state, self.state
);
}
}
}