Section: Environment variables

Enable Cargo debug logging

bash
bash
CARGO_LOG=debug cargo build
Explanation

`CARGO_LOG` is used for Cargo debug logging.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Environment variables
Change Cargo home
Use a non-default cache and install location.
OpenIn sheetbashsame section
Show a backtrace on panic
Display stack traces from Rust panics.
OpenIn sheetbashsame section
Pass custom compiler flags
Inject compiler flags for one build.
OpenIn sheetbashsame section
Set target dir by environment variable
Redirect build artifacts without editing config files.
OpenIn sheetbash2 tag match
Create project-local Cargo config
Store configuration in the project under `.cargo/config.toml`.
OpenIn sheettoml1 tag match
Build documentation
Generate docs for the package and dependencies.
OpenIn sheetbash1 tag match