diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 68ce7e6cf..1b8577f76 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -101,5 +101,22 @@ assert_that( p.cargo("run"), execs().stream().with_status(0) ); +``` + +## Logging + +Cargo uses [`env_logger`](https://docs.rs/env_logger/*/env_logger/), so you can set +`RUST_LOG` environment variable to get the logs. This is useful both for diagnosing +bugs in stable Cargo and for local development. Cargo also has internal hierarchical +profiling infrastructure, which is activated via `CARGO_PROFILE` variable ``` +# Outputs all logs with levels debug and higher +$ RUST_LOG=debug cargo generate-lockfile + +# Don't forget that you can filter by module as well +$ RUST_LOG=cargo::core::resolver=trace cargo generate-lockfile + +# Output first three levels of profiling info +$ CARGO_PROFILE=3 cargo generate-lockfile +``` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 55b29fe15..6dd831c43 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,10 +22,9 @@ and unexpected behavior. its users' security, please do not open a public issue on GitHub. Instead, we ask you to refer to Rust's [security policy].** -Opening an issue is as easy as following [this -link][new-issues] and filling out the fields. -Here's a template that you can use to file an issue, though it's not necessary to -use it exactly: +Opening an issue is as easy as following [this link][new-issues] and filling out +the fields. Here's a template that you can use to file an issue, though it's not +necessary to use it exactly: @@ -42,7 +41,8 @@ happened instead. Please use https://gist.github.com/ if your examples run long. ## Working on issues -If you're looking for somewhere to start, check out the [E-easy][E-Easy] tag. +If you're looking for somewhere to start, check out the [E-easy][E-Easy] and +[E-mentor][E-mentor] tags. Feel free to ask for guidelines on how to tackle a problem on [IRC] or open a [new issue][new-issues]. This is especially important if you want to add new