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 5, 2024
1 parent 0620f86 commit 659ab6e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 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
6 changes: 3 additions & 3 deletions core/src/client/async_client/helpers.rs
Original file line number Diff line number Diff line change
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(
Ok(_) => None,
Err(TrySubscriptionSendError::Closed) => Some(sub_id),
Err(TrySubscriptionSendError::TooSlow(m)) => {
tracing::error!(target: LOG_TARGET, "Subscription {{method={}, sub_id={:?}}} couldn't keep up with server; failed to send {m}", response.method, sub_id);
tracing::debug!(target: LOG_TARGET, "Subscription {{method={}, sub_id={:?}}} couldn't keep up with server; failed to send {m}", response.method, sub_id);
Some(sub_id)
}
},
Expand Down Expand Up @@ -156,7 +156,7 @@ pub(crate) fn process_notification(manager: &mut RequestManager, notif: Notifica
let _ = manager.remove_notification_handler(&notif.method);
}
Err(TrySubscriptionSendError::TooSlow(m)) => {
tracing::error!(target: LOG_TARGET, "Notification `{}` couldn't keep up with server; failed to send {m}", notif.method);
tracing::debug!(target: LOG_TARGET, "Notification `{}` couldn't keep up with server; failed to send {m}", notif.method);
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 659ab6e

Please sign in to comment.