Skip to content

Commit c1eab15

Browse files
peterjoelcalebcartwright
authored andcommitted
Use a custom env var for log settings intead of default RUST_LOG
# Conflicts: # src/rustfmt/main.rs
1 parent 5ce82e1 commit c1eab15

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

Contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ example, the `issue-1111.rs` test file is configured by the file
5959
## Debugging
6060

6161
Some `rewrite_*` methods use the `debug!` macro for printing useful information.
62-
These messages can be printed by using the environment variable `RUST_LOG=rustfmt=DEBUG`.
62+
These messages can be printed by using the environment variable `RUSTFMT_LOG=rustfmt=DEBUG`.
6363
These traces can be helpful in understanding which part of the code was used
6464
and get a better grasp on the execution flow.
6565

src/bin/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use crate::rustfmt::{
2020
};
2121

2222
fn main() {
23-
env_logger::init();
23+
env_logger::Builder::from_env("RUSTFMT_LOG").init();
2424
let opts = make_opts();
2525

2626
let exit_code = match execute(&opts) {

src/format-diff/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pub struct Opts {
6464
}
6565

6666
fn main() {
67-
env_logger::init();
67+
env_logger::Builder::from_env("RUSTFMT_LOG").init();
6868
let opts = Opts::from_args();
6969
if let Err(e) = run(opts) {
7070
println!("{}", e);

src/git-rustfmt/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ impl Config {
170170
}
171171

172172
fn main() {
173-
env_logger::init();
173+
env_logger::Builder::from_env("RUSTFMT_LOG").init();
174174

175175
let opts = make_opts();
176176
let matches = opts

0 commit comments

Comments
 (0)