Skip to content

Commit 432b6df

Browse files
author
The rustc-josh-sync Cronjob Bot
committed
Merge ref 'e7d90c695a39' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: rust-lang/rust@e7d90c6 Filtered ref: bc9d559 Upstream diff: rust-lang/rust@c78a294...e7d90c6 This merge was created using https://github.com/rust-lang/josh-sync.
2 parents df1b75e + bc9d559 commit 432b6df

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/tracing.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,25 @@ To see the logs, you need to set the `RUSTC_LOG` environment variable to your lo
1212
The full syntax of the log filters can be found in the [rustdoc
1313
of `tracing-subscriber`](https://docs.rs/tracing-subscriber/0.2.24/tracing_subscriber/filter/struct.EnvFilter.html#directives).
1414

15+
## Environment variables
16+
17+
This is an overview of the environment variables rustc accepts to customize
18+
its tracing output. The definition of these can mostly be found in `compiler/rustc_log/src/lib.rs`.
19+
20+
| Name | Usage |
21+
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
22+
| `RUSTC_LOG` | Tracing filters (see the rest of this page) |
23+
| `RUSTC_LOG_COLOR` | `always`, `never` or `auto`. |
24+
| `RUSTC_LOG_ENTRY_EXIT` | if set and not '0', log span entry/exit. |
25+
| `RUSTC_LOG_THREAD_IDS` | if set and equal to '1', also log thread ids. |
26+
| `RUSTC_LOG_BACKTRACE` | Capture and print a backtrace if a trace is emitted with a target that matches the provided string value. |
27+
| `RUSTC_LOG_LINES` | If `1`, indents log lines based on depth. |
28+
| `RUSTC_LOG_FORMAT_JSON` | If `1`, outputs logs as JSON. The exact parameters can be found in `rustc_log/src/lib.rs` but the format is *UNSTABLE*. |
29+
| `RUSTC_LOG_OUTPUT_TARGET` | If provided, logs go to the provided file name instead of stderr. |
30+
31+
32+
33+
1534
## Function level filters
1635

1736
Lots of functions in rustc are annotated with

0 commit comments

Comments
 (0)