Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CARGO_LOG to "Environment variables Cargo reads" #10967

Merged
merged 1 commit into from
Aug 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/doc/src/reference/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ with them:
You can override these environment variables to change Cargo's behavior on your
system:

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

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