Skip to content

Commit

Permalink
Auto merge of #17992 - Wilfred:newlines_in_logs, r=Veykril
Browse files Browse the repository at this point in the history
internal: Avoid newlines in fetch errors

Most logs lines don't have newlines, ensure fetch errors follow this pattern. This makes it easier to see which log line is associated with the error.

Before:

    2024-08-28T21:11:58.431856Z ERROR FetchWorkspaceError:
    rust-analyzer failed to discover workspace

After:

    2024-08-28T21:11:58.431856Z ERROR FetchWorkspaceError: rust-analyzer failed to discover workspace
  • Loading branch information
bors committed Aug 29, 2024
2 parents 248a557 + 5aefe78 commit 3a14e30
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tools/rust-analyzer/crates/rust-analyzer/src/main_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ impl GlobalState {
self.fetch_workspaces_queue
.op_completed(Some((workspaces, force_reload_crate_graph)));
if let Err(e) = self.fetch_workspace_error() {
error!("FetchWorkspaceError:\n{e}");
error!("FetchWorkspaceError: {e}");
}
self.wants_to_switch = Some("fetched workspace".to_owned());
(Progress::End, None)
Expand Down Expand Up @@ -729,7 +729,7 @@ impl GlobalState {
BuildDataProgress::End(build_data_result) => {
self.fetch_build_data_queue.op_completed(build_data_result);
if let Err(e) = self.fetch_build_data_error() {
error!("FetchBuildDataError:\n{e}");
error!("FetchBuildDataError: {e}");
}

if self.wants_to_switch.is_none() {
Expand Down

0 comments on commit 3a14e30

Please sign in to comment.