@@ -149,7 +149,7 @@ $ # Cool, now I have a backtrace for the error
149149These crates are used in compiler for logging:
150150
151151* [log]
152- * [env-logger]: check the link to see the full ` RUST_LOG ` syntax
152+ * [env-logger]: check the link to see the full ` RUSTC_LOG ` syntax
153153
154154[log]: https://docs.rs/log/0.4.6/log/index.html
155155[env-logger]: https://docs.rs/env_logger/0.4.3/env_logger/
@@ -159,9 +159,9 @@ at many points. These are very useful to at least narrow down the location of
159159a bug if not to find it entirely, or just to orient yourself as to why the
160160compiler is doing a particular thing.
161161
162- To see the logs, you need to set the ` RUST_LOG ` environment variable to
162+ To see the logs, you need to set the ` RUSTC_LOG ` environment variable to
163163your log filter, e.g. to get the logs for a specific module, you can run the
164- compiler as ` RUST_LOG =module::path rustc my-file.rs` . All ` debug! ` output will
164+ compiler as ` RUSTC_LOG =module::path rustc my-file.rs` . All ` debug! ` output will
165165then appear in standard error.
166166
167167** Note that unless you use a very strict filter, the logger will emit a lot of
@@ -174,16 +174,16 @@ So to put it together.
174174```bash
175175# This puts the output of all debug calls in `librustc/traits` into
176176# standard error, which might fill your console backscroll.
177- $ RUST_LOG =rustc::traits rustc +local my-file.rs
177+ $ RUSTC_LOG =rustc::traits rustc +local my-file.rs
178178
179179# This puts the output of all debug calls in `librustc/traits` in
180180# `traits-log`, so you can then see it with a text editor.
181- $ RUST_LOG =rustc::traits rustc +local my-file.rs 2>traits-log
181+ $ RUSTC_LOG =rustc::traits rustc +local my-file.rs 2>traits-log
182182
183183# Not recommended. This will show the output of all `debug!` calls
184184# in the Rust compiler, and there are a *lot* of them, so it will be
185185# hard to find anything.
186- $ RUST_LOG =debug rustc +local my-file.rs 2>all-log
186+ $ RUSTC_LOG =debug rustc +local my-file.rs 2>all-log
187187
188188# This will show the output of all `info!` calls in `rustc_trans`.
189189#
@@ -192,7 +192,7 @@ $ RUST_LOG=debug rustc +local my-file.rs 2>all-log
192192# which function triggers an LLVM assertion, and this is an `info!`
193193# log rather than a `debug!` log so it will work on the official
194194# compilers.
195- $ RUST_LOG =rustc_trans=info rustc +local my-file.rs
195+ $ RUSTC_LOG =rustc_trans=info rustc +local my-file.rs
196196` ` `
197197
198198# ## How to keep or remove `debug!` and `trace!` calls from the resulting binary
@@ -201,7 +201,7 @@ While calls to `error!`, `warn!` and `info!` are included in every build of the
201201calls to ` debug! ` and ` trace! ` are only included in the program if
202202` debug-assertions=yes` is turned on in config.toml (it is
203203turned off by default), so if you don' t see `DEBUG` logs, especially
204- if you run the compiler with `RUST_LOG =rustc rustc some.rs` and only see
204+ if you run the compiler with `RUSTC_LOG =rustc rustc some.rs` and only see
205205`INFO` logs, make sure that `debug-assertions=yes` is turned on in your
206206config.toml.
207207
@@ -230,7 +230,7 @@ If in the module `rustc::foo` you have a statement
230230debug!("{:?}", random_operation(tcx));
231231```
232232
233- Then if someone runs a debug `rustc` with `RUST_LOG =rustc::bar`, then
233+ Then if someone runs a debug `rustc` with `RUSTC_LOG =rustc::bar`, then
234234`random_operation()` will run.
235235
236236This means that you should not put anything too expensive or likely to crash
0 commit comments