Use a custom env var for log settings intead of default RUST_LOG

# Conflicts:
#	src/rustfmt/main.rs
This commit is contained in:
Peter Hall 2020-10-07 12:55:01 +01:00 committed by Caleb Cartwright
parent 5ce82e1513
commit c1eab154c9
4 changed files with 4 additions and 4 deletions

View File

@ -59,7 +59,7 @@ example, the `issue-1111.rs` test file is configured by the file
## Debugging
Some `rewrite_*` methods use the `debug!` macro for printing useful information.
These messages can be printed by using the environment variable `RUST_LOG=rustfmt=DEBUG`.
These messages can be printed by using the environment variable `RUSTFMT_LOG=rustfmt=DEBUG`.
These traces can be helpful in understanding which part of the code was used
and get a better grasp on the execution flow.

View File

@ -20,7 +20,7 @@ use crate::rustfmt::{
};
fn main() {
env_logger::init();
env_logger::Builder::from_env("RUSTFMT_LOG").init();
let opts = make_opts();
let exit_code = match execute(&opts) {

View File

@ -64,7 +64,7 @@ pub struct Opts {
}
fn main() {
env_logger::init();
env_logger::Builder::from_env("RUSTFMT_LOG").init();
let opts = Opts::from_args();
if let Err(e) = run(opts) {
println!("{}", e);

View File

@ -170,7 +170,7 @@ impl Config {
}
fn main() {
env_logger::init();
env_logger::Builder::from_env("RUSTFMT_LOG").init();
let opts = make_opts();
let matches = opts