Skip to content

Commit

Permalink
Print panic message with tracing::error
Browse files Browse the repository at this point in the history
  • Loading branch information
snowsignal committed Apr 16, 2024
1 parent 6cec603 commit 11c9136
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions crates/ruff_server/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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}");
}));
}

Expand Down

0 comments on commit 11c9136

Please sign in to comment.