@@ -149,7 +149,7 @@ $ # Cool, now I have a backtrace for the error
149
149
These crates are used in compiler for logging:
150
150
151
151
* [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
153
153
154
154
[log]: https://docs.rs/log/0.4.6/log/index.html
155
155
[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
159
159
a bug if not to find it entirely, or just to orient yourself as to why the
160
160
compiler is doing a particular thing.
161
161
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
163
163
your 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
165
165
then appear in standard error.
166
166
167
167
** 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.
174
174
```bash
175
175
# This puts the output of all debug calls in `librustc/traits` into
176
176
# 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
178
178
179
179
# This puts the output of all debug calls in `librustc/traits` in
180
180
# `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
182
182
183
183
# Not recommended. This will show the output of all `debug!` calls
184
184
# in the Rust compiler, and there are a *lot* of them, so it will be
185
185
# 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
187
187
188
188
# This will show the output of all `info!` calls in `rustc_trans`.
189
189
#
@@ -192,7 +192,7 @@ $ RUST_LOG=debug rustc +local my-file.rs 2>all-log
192
192
# which function triggers an LLVM assertion, and this is an `info!`
193
193
# log rather than a `debug!` log so it will work on the official
194
194
# compilers.
195
- $ RUST_LOG =rustc_trans=info rustc +local my-file.rs
195
+ $ RUSTC_LOG =rustc_trans=info rustc +local my-file.rs
196
196
` ` `
197
197
198
198
# ## 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
201
201
calls to ` debug! ` and ` trace! ` are only included in the program if
202
202
` debug-assertions=yes` is turned on in config.toml (it is
203
203
turned 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
205
205
`INFO` logs, make sure that `debug-assertions=yes` is turned on in your
206
206
config.toml.
207
207
@@ -230,7 +230,7 @@ If in the module `rustc::foo` you have a statement
230
230
debug!("{:?}", random_operation(tcx));
231
231
```
232
232
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
234
234
`random_operation()` will run.
235
235
236
236
This means that you should not put anything too expensive or likely to crash
0 commit comments