rust-lang / log

Logging implementation for Rust
https://docs.rs/log
Apache License 2.0
2.12k stars 248 forks source link

How do I set log level in Windows (Powershell)? #598

Closed Agent-E11 closed 8 months ago

Agent-E11 commented 8 months ago

I am trying to use log on Windows, and I have tried:

set RUST_LOG=dubug
cargo run
$RUST_LOG=debug
cargo run
$RUST_LOG=debug && cargo run
$RUST_LOG=debug; cargo run

And the only logs I am getting are errors (I am using Powershell)

Thomasdezeeuw commented 8 months ago

You need to set an environment variable, see https://stackoverflow.com/questions/55500857/how-can-i-set-the-environment-variables-in-windows.

Agent-E11 commented 8 months ago

@Thomasdezeeuw I believe I have already tried that. set RUST_LOG=debug didn't work.

Agent-E11 commented 8 months ago

I found out from another source:

$Env:<variable-name> = "<value>"
$Env:RUST_LOG = "debug"