Skip to content

chore: reduce noisy logging #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions crates/rmcp/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,9 +527,9 @@ where
tokio::sync::mpsc::channel::<TxJsonRpcMessage<R>>(SINK_PROXY_BUFFER_SIZE);

if R::IS_CLIENT {
tracing::info!(?peer_info, "Service initialized as client");
tracing::debug!(?peer_info, "Service initialized as client");
} else {
tracing::info!(?peer_info, "Service initialized as server");
tracing::debug!(?peer_info, "Service initialized as server");
}

let (peer, mut peer_proxy) = <Peer<R>>::new(id_provider, peer_info);
Expand Down Expand Up @@ -572,7 +572,7 @@ where
Event::PeerMessage(m)
} else {
// input stream closed
tracing::info!("input stream terminated");
tracing::debug!("input stream terminated");
break QuitReason::Closed
}
}
Expand All @@ -584,7 +584,7 @@ where
}
}
_ = serve_loop_ct.cancelled() => {
tracing::info!("task cancelled");
tracing::debug!("task cancelled");
break QuitReason::Cancelled
}
}
Expand Down Expand Up @@ -646,7 +646,7 @@ where
let _ = responder.send(response);
if let Some(param) = cancellation_param {
if let Some(responder) = local_responder_pool.remove(&param.request_id) {
tracing::info!(id = %param.request_id, reason = param.reason, "cancelled");
tracing::debug!(id = %param.request_id, reason = param.reason, "cancelled");
let _response_result = responder.send(Err(ServiceError::Cancelled {
reason: param.reason.clone(),
}));
Expand All @@ -656,7 +656,7 @@ where
Event::PeerMessage(JsonRpcMessage::Request(JsonRpcRequest {
id, request, ..
})) => {
tracing::info!(%id, ?request, "received request");
tracing::debug!(%id, ?request, "received request");
{
let service = shared_service.clone();
let sink = sink_proxy_tx.clone();
Expand All @@ -674,11 +674,11 @@ where
let result = service.handle_request(request, context).await;
let response = match result {
Ok(result) => {
tracing::info!(%id, ?result, "response message");
tracing::debug!(%id, ?result, "response message");
JsonRpcMessage::response(result, id)
}
Err(error) => {
tracing::warn!(%id, ?error, "response error");
tracing::debug!(%id, ?error, "response error");
JsonRpcMessage::error(error, id)
}
};
Expand All @@ -690,12 +690,12 @@ where
notification,
..
})) => {
tracing::info!(?notification, "received notification");
tracing::debug!(?notification, "received notification");
// catch cancelled notification
let notification = match notification.try_into() {
Ok::<CancelledNotification, _>(cancelled) => {
if let Some(ct) = local_ct_pool.remove(&cancelled.params.request_id) {
tracing::info!(id = %cancelled.params.request_id, reason = cancelled.params.reason, "cancelled");
tracing::debug!(id = %cancelled.params.request_id, reason = cancelled.params.reason, "cancelled");
ct.cancel();
}
cancelled.into()
Expand Down Expand Up @@ -752,7 +752,7 @@ where
if let Err(e) = sink_close_result {
tracing::error!(%e, "fail to close sink");
}
tracing::info!(?quit_reason, "serve finished");
tracing::debug!(?quit_reason, "serve finished");
quit_reason
});
Ok(RunningService {
Expand Down
4 changes: 2 additions & 2 deletions crates/rmcp/src/transport/sse_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ async fn sse_handler(
State(app): State<App>,
) -> Result<Sse<impl Stream<Item = Result<Event, io::Error>>>, Response<String>> {
let session = session_id();
tracing::info!(%session, "sse connection");
tracing::debug!(%session, "sse connection");
use tokio_stream::{StreamExt, wrappers::ReceiverStream};
use tokio_util::sync::PollSender;
let (from_client_tx, from_client_rx) = tokio::sync::mpsc::channel(64);
Expand Down Expand Up @@ -232,7 +232,7 @@ impl SseServer {
let ct = sse_server.config.ct.child_token();
let server = axum::serve(listener, service).with_graceful_shutdown(async move {
ct.cancelled().await;
tracing::info!("sse server cancelled");
tracing::debug!("sse server cancelled");
});
tokio::spawn(
async move {
Expand Down
Loading