From 11c9136a5762ffd6edcdbcb136c9eeb07b148afa Mon Sep 17 00:00:00 2001 From: Jane Lewis Date: Tue, 16 Apr 2024 11:22:15 -0700 Subject: [PATCH] Print panic message with tracing::error --- crates/ruff_server/src/message.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/crates/ruff_server/src/message.rs b/crates/ruff_server/src/message.rs index 1a14d0cbbad0e..034771aea828c 100644 --- a/crates/ruff_server/src/message.rs +++ b/crates/ruff_server/src/message.rs @@ -22,8 +22,8 @@ pub(crate) fn init_messenger(client_sender: &ClientSender) { method: lsp_types::notification::ShowMessage::METHOD.into(), params: serde_json::to_value(lsp_types::ShowMessageParams { typ: lsp_types::MessageType::ERROR, - message: format!( - "The Ruff language server exited with a panic: {panic_info}" + message: String::from( + "The Ruff language server exited with a panic. See the logs for more details." ), }) .unwrap_or_default(), @@ -32,10 +32,7 @@ pub(crate) fn init_messenger(client_sender: &ClientSender) { } let backtrace = std::backtrace::Backtrace::force_capture(); - #[allow(clippy::print_stderr)] - { - eprintln!("{panic_info}\n{backtrace}"); - } + tracing::error!("{panic_info}\n{backtrace}"); })); }