Cargo does not support this yet, but you can file an issue for it.
RUST_LOG=debug cargo test should work, you can set environment variables for single commands, and not set them for the current environment.
Additional information on the variable RUST_LOG env is here .
source share