aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-05-11 18:14:12 +0100
committerAleksey Kladov <[email protected]>2020-05-11 18:16:00 +0100
commit72e229fcb35f6056183f681e0d16c4fff8e5e381 (patch)
tree77a45256d7eedac1ab8b53d35fd036ded3d35522
parent05399250d47cdceffbf1ded08983b13a9dcc87c1 (diff)
Use RA_LOG instead of RUST_LOG for logging
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.
-rw-r--r--crates/rust-analyzer/src/bin/main.rs2
-rw-r--r--docs/dev/README.md2
-rw-r--r--docs/user/readme.adoc2
3 files changed, 3 insertions, 3 deletions
diff --git a/crates/rust-analyzer/src/bin/main.rs b/crates/rust-analyzer/src/bin/main.rs
index 22a84b50c..001f277e6 100644
--- a/crates/rust-analyzer/src/bin/main.rs
+++ b/crates/rust-analyzer/src/bin/main.rs
@@ -60,7 +60,7 @@ fn main() -> Result<()> {
60 60
61fn setup_logging() -> Result<()> { 61fn setup_logging() -> Result<()> {
62 std::env::set_var("RUST_BACKTRACE", "short"); 62 std::env::set_var("RUST_BACKTRACE", "short");
63 env_logger::try_init()?; 63 env_logger::try_init_from_env("RA_LOG")?;
64 ra_prof::init(); 64 ra_prof::init();
65 Ok(()) 65 Ok(())
66} 66}
diff --git a/docs/dev/README.md b/docs/dev/README.md
index f230dc1db..a20ead0b6 100644
--- a/docs/dev/README.md
+++ b/docs/dev/README.md
@@ -134,7 +134,7 @@ To log all communication between the server and the client, there are two choice
134 134
135* you can log on the server side, by running something like 135* you can log on the server side, by running something like
136 ``` 136 ```
137 env RUST_LOG=gen_lsp_server=trace code . 137 env RA_LOG=gen_lsp_server=trace code .
138 ``` 138 ```
139 139
140* you can log on the client side, by enabling `"rust-analyzer.trace.server": 140* you can log on the client side, by enabling `"rust-analyzer.trace.server":
diff --git a/docs/user/readme.adoc b/docs/user/readme.adoc
index f6ce0accf..d750c7705 100644
--- a/docs/user/readme.adoc
+++ b/docs/user/readme.adoc
@@ -108,7 +108,7 @@ Here are some useful self-diagnostic commands:
108 108
109* **Rust Analyzer: Show RA Version** shows the version of `rust-analyzer` binary 109* **Rust Analyzer: Show RA Version** shows the version of `rust-analyzer` binary
110* **Rust Analyzer: Status** prints some statistics about the server, like the few latest LSP requests 110* **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.
112* To log all LSP requests, add `"rust-analyzer.trace.server": "verbose"` to the settings and look for `Server Trace` in the panel. 112* To log all LSP requests, add `"rust-analyzer.trace.server": "verbose"` to the settings and look for `Server Trace` in the panel.
113* To enable client-side logging, add `"rust-analyzer.trace.extension": true` to the settings and open the `Console` tab of VS Code developer tools. 113* To enable client-side logging, add `"rust-analyzer.trace.extension": true` to the settings and open the `Console` tab of VS Code developer tools.
114 114