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 d2b1045
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions crates/ruff_server/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub(crate) fn init_messenger(client_sender: &ClientSender) {
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}"
"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 d2b1045

Please sign in to comment.