net: Improve log message.

This commit is contained in:
parazyd
2023-08-10 17:23:57 +02:00
parent 9b61334f1a
commit 78c4180c90
2 changed files with 9 additions and 3 deletions

View File

@@ -108,7 +108,7 @@ impl ProtocolPing {
// so close the connection.
warn!(
target: "net::protocol_ping::run_ping_pong()",
"Ping-Pong protocol timed out for {}", self.channel.address(),
"[P2P] Ping-Pong protocol timed out for {}", self.channel.address(),
);
self.channel.stop().await;
return Err(Error::ChannelStopped)

View File

@@ -87,7 +87,10 @@ impl<T: Clone> Subscriber<T> {
pub async fn notify(&self, message_result: T) {
for sub in (*self.subs.lock().await).values() {
if let Err(e) = sub.send(message_result.clone()).await {
warn!(target: "system::subscriber", "Error returned sending message in notify() call! {}", e);
warn!(
target: "system::subscriber",
"[system::subscriber] Error returned sending message in notify() call: {}", e,
);
}
}
}
@@ -99,7 +102,10 @@ impl<T: Clone> Subscriber<T> {
}
if let Err(e) = sub.send(message_result.clone()).await {
warn!(target: "system::subscriber", "Error returned sending message in notify_with_exclude() call! {}", e);
warn!(
target: "system::subscriber",
"[system::subscriber] Error returned sending message in notify_with_exclude() call! {}", e,
);
}
}
}