Skip to content

Commit f1319d7

Browse files
committed
adjust log levels
1 parent d458aeb commit f1319d7

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

src/core.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub(crate) async fn reply_disconnected(id: &RequestId, stdout_sink: &mut StdoutS
3030
);
3131

3232
if let Err(e) = stdout_sink.send(error_response).await {
33-
info!("Error writing disconnected error response to stdout: {}", e);
33+
error!("Error writing disconnected error response to stdout: {}", e);
3434
}
3535

3636
Ok(())
@@ -66,7 +66,7 @@ pub(crate) async fn try_reconnect(
6666
Ok(new_transport)
6767
}
6868
Err(e) => {
69-
info!("Failed to reconnect: {}", e);
69+
error!("Failed to reconnect: {}", e);
7070
Err(ReconnectFailureReason::ConnectionFailed(e.into()))
7171
}
7272
}
@@ -85,7 +85,7 @@ pub(crate) async fn send_request_to_sse(
8585
match transport.send(request.clone()).await {
8686
Ok(_) => Ok(true),
8787
Err(e) => {
88-
info!("Error sending to SSE: {}", e);
88+
error!("Error sending to SSE: {}", e);
8989
app_state.disconnected();
9090

9191
if app_state.buf_mode == BufferMode::Store {
@@ -103,7 +103,7 @@ pub(crate) async fn send_request_to_sse(
103103
original_id,
104104
);
105105
if let Err(write_err) = stdout_sink.send(error_response).await {
106-
info!("Error writing error response to stdout: {}", write_err);
106+
error!("Error writing error response to stdout: {}", write_err);
107107
}
108108
}
109109
Ok(false)
@@ -132,7 +132,7 @@ pub(crate) async fn process_client_request(
132132
req.id.clone(),
133133
);
134134
if let Err(e) = stdout_sink.send(response).await {
135-
info!("Error sending direct ping response to stdout: {}", e);
135+
error!("Error sending direct ping response to stdout: {}", e);
136136
}
137137
return Ok(());
138138
}
@@ -178,7 +178,7 @@ pub(crate) async fn process_client_request(
178178
// Send other message types (Notifications, mapped Responses/Errors)
179179
debug!("Forwarding message from stdin to SSE: {:?}", message);
180180
if let Err(e) = transport.send(message).await {
181-
info!("Error sending message to SSE: {}", e);
181+
error!("Error sending message to SSE: {}", e);
182182
app_state.handle_fatal_transport_error();
183183
}
184184

@@ -205,7 +205,7 @@ pub(crate) async fn process_buffered_messages(
205205
app_state.id_map.insert(new_id, request_id.clone());
206206

207207
if let Err(e) = transport.send(ClientJsonRpcMessage::Request(req)).await {
208-
info!("Error sending buffered request: {}", e);
208+
error!("Error sending buffered request: {}", e);
209209
let error_response = ServerJsonRpcMessage::error(
210210
ErrorData::new(
211211
TRANSPORT_SEND_ERROR_CODE,
@@ -215,14 +215,14 @@ pub(crate) async fn process_buffered_messages(
215215
request_id,
216216
);
217217
if let Err(write_err) = stdout_sink.send(error_response).await {
218-
info!("Error writing error response to stdout: {}", write_err);
218+
error!("Error writing error response to stdout: {}", write_err);
219219
}
220220
}
221221
}
222222
_ => {
223223
// Notifications etc.
224224
if let Err(e) = transport.send(message.clone()).await {
225-
info!("Error sending buffered message: {}", e);
225+
error!("Error sending buffered message: {}", e);
226226
// If sending a buffered notification fails, we probably just log it.
227227
// Triggering another disconnect cycle might be excessive.
228228
}

src/state.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ impl AppState {
218218
Ok(true)
219219
}
220220
Some(Err(e)) => {
221-
info!("Error reading from stdin: {}", e);
221+
error!("Error reading from stdin: {}", e);
222222
Ok(false)
223223
}
224224
None => {
@@ -286,7 +286,7 @@ impl AppState {
286286
),
287287
);
288288
if let Err(e) = transport.send(initialized_notification).await {
289-
info!(
289+
error!(
290290
"Error sending initialized notification post-reconnect: {}",
291291
e
292292
);
@@ -318,14 +318,14 @@ impl AppState {
318318
// This now handles mapped server requests, mapped responses/errors, and notifications
319319
debug!("Forwarding from SSE to stdout: {:?}", message);
320320
if let Err(e) = stdout_sink.send(message).await {
321-
info!("Error writing to stdout: {}", e);
321+
error!("Error writing to stdout: {}", e);
322322
return Ok(false);
323323
}
324324

325325
Ok(true)
326326
}
327327
None => {
328-
info!("SSE stream ended (Fatal error in transport)");
328+
debug!("SSE stream ended (Fatal error in transport) - trying to reconnect");
329329
self.handle_fatal_transport_error();
330330
Ok(true)
331331
}
@@ -414,7 +414,7 @@ impl AppState {
414414
self.update_heartbeat();
415415
}
416416
Some(false) => {
417-
info!("Heartbeat check failed - connection confirmed down");
417+
debug!("Heartbeat check failed - connection confirmed down");
418418
self.handle_fatal_transport_error();
419419
}
420420
None => {}
@@ -443,7 +443,7 @@ impl AppState {
443443
if is_response_or_error {
444444
if let Some(current_id) = id_to_check {
445445
if let Some(original_id) = self.lookup_and_remove_original_id(&current_id) {
446-
info!(
446+
debug!(
447447
"Mapping client message ID {} back to original server ID: {}",
448448
current_id, original_id
449449
);
@@ -494,7 +494,7 @@ impl AppState {
494494
if is_response_or_error {
495495
if let Some(current_id) = id_to_check {
496496
if let Some(original_id) = self.lookup_and_remove_original_id(&current_id) {
497-
info!(
497+
debug!(
498498
"Mapping server message ID {} back to original client ID: {}",
499499
current_id, original_id
500500
);

0 commit comments

Comments
 (0)