Skip to content

Commit fcf3281

Browse files
committed
Auto merge of #10967 - hi-rustin:rustin-patch-docs, r=epage
Add `CARGO_LOG` to "Environment variables Cargo reads" ### What does this PR try to resolve? close #10947
2 parents ce40690 + ccf81ae commit fcf3281

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/doc/src/reference/environment-variables.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ with them:
99
You can override these environment variables to change Cargo's behavior on your
1010
system:
1111

12+
* `CARGO_LOG` - Cargo uses the [`env_logger`] crate to display debug log messages.
13+
The `CARGO_LOG` environment variable can be set to enable debug logging,
14+
with a value such as `trace`, `debug`, or `warn`.
15+
Usually it is only used during debugging. For more details refer to the
16+
[Debug logging].
1217
* `CARGO_HOME` — Cargo maintains a local cache of the registry index and of
1318
git checkouts of crates. By default these are stored under `$HOME/.cargo`
1419
(`%USERPROFILE%\.cargo` on Windows), but this variable overrides the
@@ -39,17 +44,17 @@ system:
3944
invocations that Cargo performs. In contrast with [`cargo rustdoc`], this is
4045
useful for passing a flag to *all* `rustdoc` instances. See
4146
[`build.rustdocflags`] for some more ways to set flags. This string is
42-
split by whitespace; for a more robust encoding of multiple arguments,
47+
split by whitespace; for a more robust encoding of multiple arguments,
4348
see `CARGO_ENCODED_RUSTDOCFLAGS`.
44-
* `CARGO_ENCODED_RUSTDOCFLAGS` - A list of custom flags separated by `0x1f`
49+
* `CARGO_ENCODED_RUSTDOCFLAGS` - A list of custom flags separated by `0x1f`
4550
(ASCII Unit Separator) to pass to all `rustdoc` invocations that Cargo performs.
4651
* `RUSTFLAGS` — A space-separated list of custom flags to pass to all compiler
4752
invocations that Cargo performs. In contrast with [`cargo rustc`], this is
4853
useful for passing a flag to *all* compiler instances. See
4954
[`build.rustflags`] for some more ways to set flags. This string is
50-
split by whitespace; for a more robust encoding of multiple arguments,
55+
split by whitespace; for a more robust encoding of multiple arguments,
5156
see `CARGO_ENCODED_RUSTFLAGS`.
52-
* `CARGO_ENCODED_RUSTFLAGS` - A list of custom flags separated by `0x1f`
57+
* `CARGO_ENCODED_RUSTFLAGS` - A list of custom flags separated by `0x1f`
5358
(ASCII Unit Separator) to pass to all compiler invocations that Cargo performs.
5459
* `CARGO_INCREMENTAL` — If this is set to 1 then Cargo will force [incremental
5560
compilation] to be enabled for the current compilation, and when set to 0 it
@@ -369,6 +374,8 @@ let out_dir = env::var("OUT_DIR").unwrap();
369374
the environment; scripts should use `CARGO_ENCODED_RUSTFLAGS` instead.
370375
* `CARGO_PKG_<var>` - The package information variables, with the same names and values as are [provided during crate building][variables set for crates].
371376

377+
[`env_logger`]: https://docs.rs/env_logger
378+
[debug logging]: https://doc.crates.io/contrib/architecture/console.html#debug-logging
372379
[unix-like platforms]: ../../reference/conditional-compilation.html#unix-and-windows
373380
[windows-like platforms]: ../../reference/conditional-compilation.html#unix-and-windows
374381
[target family]: ../../reference/conditional-compilation.html#target_family

0 commit comments

Comments
 (0)