Skip to content

Commit

Permalink
Improve logging infrastructure.
Browse files Browse the repository at this point in the history
This enables logging in (some) tests, and allows disabling logging
at compile time with a crate-level feature flag.

Also adds tracing-subscriber as an optional dependency of CLI utilities.
  • Loading branch information
veluca93 committed Oct 2, 2024
1 parent bc8a864 commit bc053d1
Show file tree
Hide file tree
Showing 23 changed files with 338 additions and 81 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ jobs:
run: cargo fmt --all -- --check

- name: Clippy
run: cargo clippy --all-targets --all-features --tests --all -- -D warnings
run: cargo clippy --release --all-targets --all-features --tests --all -- -D warnings

- name: Clippy with default features
run: cargo clippy --release --all-targets --tests --all -- -D warnings

- name: Run tests
run: cargo test --all --no-fail-fast --all-features
run: cargo test --release --all --no-fail-fast --all-features

- name: Run tests with default features
run: cargo test --release --all --no-fail-fast
234 changes: 232 additions & 2 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
debug = true

[workspace]
members = [ "jxl", "jxl_cli", "jxl_headers_derive"]
members = ["jxl", "jxl_cli", "jxl_macros"]
resolver = "2"

[workspace.lints.clippy]
Expand Down
5 changes: 3 additions & 2 deletions jxl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ num-derive = "0.3"
num-traits = "0.2.14"
array-init = "2.0.0"
half = "1.7.1"
tracing = "0.1.40"
jxl_headers_derive = { path = "../jxl_headers_derive" }
tracing = { version = "0.1.40", optional = true }
jxl_macros = { path = "../jxl_macros" }

[dev-dependencies]
arbtest = "0.3.1"
test-log = { version = "0.2.16", features = ["trace"] }

[features]
debug_tools = []
Expand Down
1 change: 1 addition & 0 deletions jxl/src/container/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ impl ContainerParser {
#[cfg(test)]
mod test {
use super::*;
use test_log::test;

#[rustfmt::skip]
const HEADER: &[u8] = &[
Expand Down
Loading

0 comments on commit bc053d1

Please sign in to comment.