0

I was working with log and env_logger crate and its documentation says that we can set the RUST_LOG environment variable to different levels to filter out logs of lower-level, RUST_LOG=debug will filter out all logs of trace level.
I tried running this command RUST_LOG=debug cargo run and i get this following error

RUST_LOG=debug : The term 'RUST_LOG=debug' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was 
included, verify that the path is correct and try again.

how do i solve this?

cafce25
  • 15,907
  • 4
  • 25
  • 31
  • 1
    Judging from the error message, you are using powershell. The syntax you used above in specific to unix shells, and therefore doesn't work. Try using `$env:RUST_LOG = 'debug'` followed by `cargo run` instead – ChrisB May 25 '23 at 14:15
  • i tried doing that ```$env:RUST_LOG = trace``` and i get the following error```trace : The term 'trace' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.``` – Sarang Dutta May 25 '23 at 14:17
  • You should use a string: `$env:RUST_LOG="debug"; cargo run`. – Chayim Friedman May 25 '23 at 14:18

0 Answers0