File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
src/doc/rustc-dev-guide/src Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ pub struct LoggerConfig {
6666
6767impl LoggerConfig {
6868 pub fn from_env ( env : & str ) -> Self {
69+ // NOTE: documented in the dev guide. If you change this, also update it!
6970 LoggerConfig {
7071 filter : env:: var ( env) ,
7172 color_logs : env:: var ( format ! ( "{env}_COLOR" ) ) ,
Original file line number Diff line number Diff line change @@ -12,6 +12,25 @@ To see the logs, you need to set the `RUSTC_LOG` environment variable to your lo
1212The full syntax of the log filters can be found in the [ rustdoc
1313of ` 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
1736Lots of functions in rustc are annotated with
You can’t perform that action at this time.
0 commit comments