auto-reconnect: more context in logs
This commit is contained in:
parent
3667c61552
commit
d776ed9dca
|
@ -67,7 +67,7 @@ impl AutoReconnect {
|
|||
let lock = self.current.read().await;
|
||||
if let ConnectionState::Connection(conn) = &*lock {
|
||||
if conn.close_reason().is_none() {
|
||||
debug!("Reuse connection {}", conn.stable_id());
|
||||
debug!("Reuse connection {} to {}", conn.stable_id(), self.target_address);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -78,8 +78,9 @@ impl AutoReconnect {
|
|||
if current.close_reason().is_some() {
|
||||
let old_stable_id = current.stable_id();
|
||||
warn!(
|
||||
"Connection {} is closed for reason: {:?}",
|
||||
"Connection {} to {} is closed for reason: {:?}",
|
||||
old_stable_id,
|
||||
self.target_address,
|
||||
current.close_reason()
|
||||
);
|
||||
|
||||
|
@ -115,7 +116,7 @@ impl AutoReconnect {
|
|||
}
|
||||
};
|
||||
} else {
|
||||
debug!("Reuse connection {} with write-lock", current.stable_id());
|
||||
debug!("Reuse connection {} to {} with write-lock", current.stable_id(), self.target_address);
|
||||
}
|
||||
}
|
||||
ConnectionState::NotConnected => {
|
||||
|
@ -141,7 +142,7 @@ impl AutoReconnect {
|
|||
}
|
||||
ConnectionState::PermanentError => {
|
||||
// no nothing
|
||||
debug!("Not using connection with permanent error");
|
||||
debug!("Not using connection to {} with permanent error", self.target_address);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue