Skip to content

Commit

Permalink
deps(common/log): drop env_logger's auto-color and regex features
Browse files Browse the repository at this point in the history
#2291 added additional formatting to our log
output via `env_logger`'s `auto-color` feature. The `auto-color` feature adds
the `is-terminal` crate dependency. `is-terminal` depends on `hermit-abi`
`v0.4`.

Pulling latest Neqo `v0.12.0` into mozilla-central adds `is-terminal` and
`hermit-abi` `v0.4.0` to the Firefox dependency tree.

In order to keep our dependency footprint low, I suggest not enabling the two
`env-logger` features.
  • Loading branch information
mxinden committed Jan 17, 2025
1 parent a7e2fb0 commit a62a32d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 23 deletions.
12 changes: 0 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion neqo-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ workspace = true
[dependencies]
# Checked against https://searchfox.org/mozilla-central/source/Cargo.lock 2024-11-11
enum-map = { workspace = true }
env_logger = { version = "0.10", default-features = false, features = ["auto-color", "regex"] }
env_logger = { version = "0.10", default-features = false }
hex = { version = "0.4", default-features = false, features = ["alloc"], optional = true }
log = { workspace = true }
qlog = { workspace = true }
Expand Down
14 changes: 4 additions & 10 deletions neqo-common/src/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,12 @@ pub fn init(level_filter: Option<log::LevelFilter>) {
}
builder.format(|buf, record| {
let elapsed = since_start();
let level_style = buf.default_level_style(record.level());
let mut bold = buf.style();
bold.set_bold(true);
writeln!(
buf,
"{} {} {}",
bold.value(format!(
"{}.{:03}",
elapsed.as_secs(),
elapsed.as_millis() % 1000
)),
level_style.value(record.level()),
"{}.{:03} {} {}",
elapsed.as_secs(),
elapsed.as_millis() % 1000,
record.level(),
record.args()
)
});
Expand Down

0 comments on commit a62a32d

Please sign in to comment.