3

When I build a Rust project using cargo build, I get error messages in the terminal. Are these error messages stored in a log file?

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
David
  • 53
  • 6

1 Answers1

3

No, but if you'd like to store them, you can use cargo build 2>./log, which redirects all errors to be written to the file ./log.

Jeremy Meadows
  • 2,314
  • 1
  • 6
  • 22
  • 4
    If the logs are meant to be machine-read, `rustc` and `cargo` have `--error-format json` and `--message-format json` respectively. – mcarton Jul 03 '21 at 14:46