Rust Env Logger Variable

02 Sep 2020

Self note post.

The env_logger crate in Rust which provides the underlying logging facilities for the log crate requires an environment variable to be set which configures the log levels (and subsequently which logs to show in the console) - RUST_LOG.

Log levels

Commands for various shells

  1. Powershell
    $Env:RUST_LOG="debug"
    
  2. CMD
    set RUST_LOG=debug
    
  3. Bash/ZSH - Linux/Mac
    export RUST_LOG="debug"
    

More information.

PS. I’m liking how simple the logging facility is with the env_logger and log crates!