From 1dc2c17fff9d58434aed31a200da0665b3935209 Mon Sep 17 00:00:00 2001 From: Yiannis Marangos Date: Tue, 11 Jun 2024 11:18:56 +0300 Subject: [PATCH] remove `beetswap error` prefix in messages --- src/cid_prefix.rs | 2 +- src/client.rs | 2 +- src/incoming_stream.rs | 18 ++++++------------ src/server.rs | 4 ++-- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/cid_prefix.rs b/src/cid_prefix.rs index 3c292fd..3a0dfa7 100644 --- a/src/cid_prefix.rs +++ b/src/cid_prefix.rs @@ -90,7 +90,7 @@ impl CidPrefix { ) -> Result, MultihasherError> { if self.multihash_size > S { debug!( - "beetswap error: Multihash<{}> can not hold multihash of size {}", + "Multihash<{}> can not hold multihash of size {}", S, self.multihash_size ); return Err(MultihasherError::InvalidMultihashSize); diff --git a/src/client.rs b/src/client.rs index 58e0c37..e84670f 100644 --- a/src/client.rs +++ b/src/client.rs @@ -570,7 +570,7 @@ impl ClientConnectionHandler { } fn close_sink_on_error(&mut self, location: &str) { - debug!("beetswap error: sink operation failed, closing: {location}"); + debug!("sink operation failed, closing: {location}"); self.sink_state = SinkState::None; } diff --git a/src/incoming_stream.rs b/src/incoming_stream.rs index 8695857..5cb199a 100644 --- a/src/incoming_stream.rs +++ b/src/incoming_stream.rs @@ -87,7 +87,7 @@ impl futures_core::stream::Stream for IncomingStream { let msg = match self.stream.poll_next_unpin(cx) { Poll::Ready(Some(Ok(msg))) => msg, Poll::Ready(Some(Err(e))) => { - debug!("beetswap error: Message decoding failed: {e}"); + debug!("Message decoding failed: {e}"); return Poll::Ready(None); } Poll::Ready(None) => return Poll::Ready(None), @@ -116,10 +116,7 @@ async fn process_message( let cid = match CidGeneric::try_from(&block_presence.cid[..]) { Ok(cid) => cid, Err(e) => { - debug!( - "beetswap error: Invalid CID bytes: {}: {:?}", - e, block_presence.cid - ); + debug!("Invalid CID bytes: {}: {:?}", e, block_presence.cid); return None; } }; @@ -133,10 +130,7 @@ async fn process_message( for payload in msg.payload { let Some(cid_prefix) = CidPrefix::from_bytes(&payload.prefix) else { - debug!( - "beeswap error: block.prefix not decodable: {:?}", - payload.prefix - ); + debug!("block.prefix not decodable: {:?}", payload.prefix); return None; }; @@ -144,18 +138,18 @@ async fn process_message( Ok(cid) => cid, Err(MultihasherError::UnknownMultihashCode) => { debug!( - "beetswap error: Multihasher non-fatal error: Unknown multihash code: {}", + "Multihasher non-fatal error: Unknown multihash code: {}", cid_prefix.multihash_code() ); continue; } Err(MultihasherError::Custom(e)) => { - debug!("beetswap error: Multihasher non-fatal error: {e}"); + debug!("Multihasher non-fatal error: {e}"); continue; } // Any other error is fatal and we need to close the stream. Err(e) => { - debug!("beetswap error: Multihasher fatal error: {e}"); + debug!("Multihasher fatal error: {e}"); return None; } }; diff --git a/src/server.rs b/src/server.rs index 96cadc8..71b45a0 100644 --- a/src/server.rs +++ b/src/server.rs @@ -271,7 +271,7 @@ where self.outgoing_queue.push_back((cid, data)); } Err(e) => { - debug!("beetswap error: Fetching {cid} from blockstore failed: {e}"); + debug!("Fetching {cid} from blockstore failed: {e}"); } } } @@ -393,7 +393,7 @@ impl ServerConnectionHandler { } fn close_sink_on_error(&mut self, location: &str) { - debug!("beetswap error: sink operation failed, closing: {location}"); + debug!("sink operation failed, closing: {location}"); self.sink = SinkState::None; }