Skip to content

Commit c6023c0

Browse files
authored
[red-knot] Add docs on using RAYON_NUM_THREADS for better logging (#13140)
Followup to #13049. We check files concurrently now; to get readable logs, you probably want to switch that off
1 parent df694ca commit c6023c0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

crates/red_knot/docs/tracing.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,17 @@ The CLI supports different verbosity levels.
1313
- `-vv` activates `debug!` and timestamps: This should be enough information to get to the bottom of bug reports. When you're processing many packages or files, you'll get pages and pages of output, but each line is link to a specific action or state change.
1414
- `-vvv` activates `trace!` (only in debug builds) and shows tracing-spans: At this level, you're logging everything. Most of this is wasted, it's really slow, we dump e.g. the entire resolution graph. Only useful to developers, and you almost certainly want to use `RED_KNOT_LOG` to filter it down to the area your investigating.
1515

16-
## `RED_KNOT_LOG`
16+
## Better logging with `RED_KNOT_LOG` and `RAYON_NUM_THREADS`
1717

1818
By default, the CLI shows messages from the `ruff` and `red_knot` crates. Tracing messages from other crates are not shown.
1919
The `RED_KNOT_LOG` environment variable allows you to customize which messages are shown by specifying one
2020
or more [filter directives](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives).
2121

22+
The `RAYON_NUM_THREADS` environment variable, meanwhile, can be used to control the level of concurrency red-knot uses.
23+
By default, red-knot will attempt to parallelize its work so that multiple files are checked simultaneously,
24+
but this can result in a confused logging output where messages from different threads are intertwined.
25+
To switch off concurrency entirely and have more readable logs, use `RAYON_NUM_THREADS=1`.
26+
2227
### Examples
2328

2429
#### Show all debug messages

0 commit comments

Comments
 (0)