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?
Asked
Active
Viewed 1,529 times
3

Shepmaster
- 388,571
- 95
- 1,107
- 1,366

David
- 53
- 6
1 Answers
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
-
4If 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