Skip to content

Commit 115347a

Browse files
bors[bot]matklad
andauthored
Merge #4424
4424: Use RA_LOG instead of RUST_LOG for logging r=matklad a=matklad RUST_LOG might be set up for debugging the user's problem, slowing down rust-analyzer considerably. That's the same reason why rustc uses RUSTC_LOG. bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
2 parents 0539925 + 72e229f commit 115347a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

crates/rust-analyzer/src/bin/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ fn main() -> Result<()> {
6060

6161
fn setup_logging() -> Result<()> {
6262
std::env::set_var("RUST_BACKTRACE", "short");
63-
env_logger::try_init()?;
63+
env_logger::try_init_from_env("RA_LOG")?;
6464
ra_prof::init();
6565
Ok(())
6666
}

docs/dev/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ To log all communication between the server and the client, there are two choice
134134

135135
* you can log on the server side, by running something like
136136
```
137-
env RUST_LOG=gen_lsp_server=trace code .
137+
env RA_LOG=gen_lsp_server=trace code .
138138
```
139139

140140
* you can log on the client side, by enabling `"rust-analyzer.trace.server":

docs/user/readme.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Here are some useful self-diagnostic commands:
108108

109109
* **Rust Analyzer: Show RA Version** shows the version of `rust-analyzer` binary
110110
* **Rust Analyzer: Status** prints some statistics about the server, like the few latest LSP requests
111-
* To enable server-side logging, run with `env RUST_LOG=info` and see `Output > Rust Analyzer Language Server` in VS Code's panel.
111+
* To enable server-side logging, run with `env RA_LOG=info` and see `Output > Rust Analyzer Language Server` in VS Code's panel.
112112
* To log all LSP requests, add `"rust-analyzer.trace.server": "verbose"` to the settings and look for `Server Trace` in the panel.
113113
* To enable client-side logging, add `"rust-analyzer.trace.extension": true` to the settings and open the `Console` tab of VS Code developer tools.
114114

0 commit comments

Comments
 (0)