Skip to content

Commit

Permalink
client: downgrade logs from error/warn -> debug (#1343)
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasad1 committed Apr 8, 2024
1 parent 8b8ca01 commit 1a02a59
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion client/transport/src/ws/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ impl WsTransportClientBuilder {
Ok(uri) => {
// Absolute URI.
target = uri.try_into().map_err(|e| {
tracing::error!(target: LOG_TARGET, "Redirection failed: {:?}", e);
tracing::debug!(target: LOG_TARGET, "Redirection failed: {:?}", e);
e
})?;

Expand Down
10 changes: 5 additions & 5 deletions core/src/client/async_client/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
// IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.

use crate::client::async_client::LOG_TARGET;
use crate::client::async_client::manager::{RequestManager, RequestStatus};
use crate::client::{RequestMessage, TransportSenderT, Error};
use crate::client::async_client::LOG_TARGET;
use crate::client::{Error, RequestMessage, TransportSenderT};
use crate::params::ArrayParams;
use crate::traits::ToRpcParams;

Expand Down Expand Up @@ -63,7 +63,7 @@ pub(crate) fn process_batch_response(
let batch_state = match manager.complete_pending_batch(range.clone()) {
Some(state) => state,
None => {
tracing::warn!(target: LOG_TARGET, "Received unknown batch response");
tracing::debug!(target: LOG_TARGET, "Received unknown batch response");
return Err(InvalidRequestId::NotPendingRequest(format!("{:?}", range)));
}
};
Expand Down Expand Up @@ -110,7 +110,7 @@ pub(crate) fn process_subscription_response(
Some(send_back_sink) => match send_back_sink.try_send(response.params.result) {
Ok(()) => Ok(()),
Err(err) => {
tracing::error!(target: LOG_TARGET, "Dropping subscription {:?} error: {:?}", sub_id, err);
tracing::debug!(target: LOG_TARGET, "Dropping subscription {:?} error: {:?}", sub_id, err);
Err(Some(sub_id))
}
},
Expand Down Expand Up @@ -153,7 +153,7 @@ pub(crate) fn process_notification(manager: &mut RequestManager, notif: Notifica
Some(send_back_sink) => match send_back_sink.try_send(notif.params) {
Ok(()) => (),
Err(err) => {
tracing::warn!(target: LOG_TARGET, "Could not send notification, dropping handler for {:?} error: {:?}", notif.method, err);
tracing::debug!(target: LOG_TARGET, "Could not send notification, dropping handler for {:?} error: {:?}", notif.method, err);
let _ = manager.remove_notification_handler(&notif.method);
}
},
Expand Down
12 changes: 6 additions & 6 deletions core/src/client/async_client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ async fn handle_frontend_messages<S: TransportSenderT>(
match message {
FrontToBack::Batch(batch) => {
if let Err(send_back) = manager.lock().insert_pending_batch(batch.ids.clone(), batch.send_back) {
tracing::warn!(target: LOG_TARGET, "Batch request already pending: {:?}", batch.ids);
tracing::debug!(target: LOG_TARGET, "Batch request already pending: {:?}", batch.ids);
let _ = send_back.send(Err(InvalidRequestId::Occupied(format!("{:?}", batch.ids)).into()));
return Ok(());
}
Expand All @@ -860,7 +860,7 @@ async fn handle_frontend_messages<S: TransportSenderT>(
// User called `request` on the front-end
FrontToBack::Request(request) => {
if let Err(send_back) = manager.lock().insert_pending_call(request.id.clone(), request.send_back) {
tracing::warn!(target: LOG_TARGET, "Denied duplicate method call");
tracing::debug!(target: LOG_TARGET, "Denied duplicate method call");

if let Some(s) = send_back {
let _ = s.send(Err(InvalidRequestId::Occupied(request.id.to_string()).into()));
Expand All @@ -878,7 +878,7 @@ async fn handle_frontend_messages<S: TransportSenderT>(
sub.send_back,
sub.unsubscribe_method,
) {
tracing::warn!(target: LOG_TARGET, "Denied duplicate subscription");
tracing::debug!(target: LOG_TARGET, "Denied duplicate subscription");

let _ = send_back.send(Err(InvalidRequestId::Occupied(format!(
"sub_id={}:req_id={}",
Expand Down Expand Up @@ -974,13 +974,13 @@ where
if let Err(e) =
handle_frontend_messages(msg, &manager, &mut sender, max_buffer_capacity_per_subscription).await
{
tracing::error!(target: LOG_TARGET, "ws send failed: {e}");
tracing::debug!(target: LOG_TARGET, "ws send failed: {e}");
break Err(Error::Transport(e.into()));
}
}
_ = ping_interval.next() => {
if let Err(err) = sender.send_ping().await {
tracing::error!(target: LOG_TARGET, "Send ws ping failed: {err}");
tracing::debug!(target: LOG_TARGET, "Send ws ping failed: {err}");
break Err(Error::Transport(err.into()));
}
}
Expand Down Expand Up @@ -1051,7 +1051,7 @@ where
}
}
Err(e) => {
tracing::error!(target: LOG_TARGET, "Failed to read message: {e}");
tracing::debug!(target: LOG_TARGET, "Failed to read message: {e}");
break Err(e);
}
}
Expand Down

0 comments on commit 1a02a59

Please sign in to comment.