1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! Zero-cost conditional logging macros for `img4avif`.
//!
//! When the `dev-logging` Cargo feature is enabled these macros delegate to the
//! [`log`] crate facade, which means any compatible subscriber (e.g.
//! [`env_logger`](https://docs.rs/env_logger), [`tracing-log`](https://docs.rs/tracing-log),
//! or [`simplelog`](https://docs.rs/simplelog)) will receive structured records.
//!
//! When `dev-logging` is **disabled** (the default) every macro expands to a
//! unit expression `()` — the compiler removes them entirely, so there is
//! literally zero runtime cost.
//!
//! # Filtering
//!
//! All records are emitted under the `img4avif` target. To see only this
//! library's logs with `env_logger`:
//!
//! ```sh
//! RUST_LOG=img4avif=debug cargo run
//! ```
//!
//! # Levels used by this library
//!
//! | Level | Used for |
//! |-------|---------|
//! | `ERROR` | Error paths — emitted just before returning `Err(…)` |
//! | `WARN` | Non-fatal surprises (metadata preserved, suspicious output size) |
//! | `INFO` | Per-image pipeline milestones (decoded, encoded, compression ratio) |
//! | `DEBUG` | Detailed sub-step data (pixel count, quality settings, RSS readings) |
/// Emit a `DEBUG`-level log record when the `dev-logging` feature is enabled.
///
/// Has zero cost when the feature is off — the call is erased by the compiler.
/// Emit an `INFO`-level log record when the `dev-logging` feature is enabled.
/// Emit a `WARN`-level log record when the `dev-logging` feature is enabled.
/// Emit an `ERROR`-level log record when the `dev-logging` feature is enabled.
// Make macros available throughout the crate.
pub use img_debug;
pub use img_error;
pub use img_info;
pub use img_warn;