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
//! Internal diagnostic-logging shim.
//!
//! [`diag_debug!`] and [`diag_trace!`] emit `tracing` events when the `tracing`
//! feature is enabled, and compile to nothing otherwise while still borrowing
//! their arguments (so they never trip an unused-variable warning in the default,
//! dependency-free build). Use plain format-string syntax:
//!
//! ```ignore
//! diag_debug!("cancel wedged the device (txn={}), resetting", txn);
//! diag_trace!("drained {} packets ({} bytes)", packets, bytes);
//! ```
//!
//! Reporters capture the cancel/reset path (issue #18) by building with
//! `--features tracing` and running under a subscriber with
//! `RUST_LOG=mtp_rs=debug` (the CLI wires one up for its `-v` flags).
/// Emit a `debug`-level diagnostic (notable events: cancel steps, wedge
/// detection, reset). No-op unless the `tracing` feature is on.
/// Emit a `trace`-level diagnostic (fine-grained: per-operation execution).
/// No-op unless the `tracing` feature is on.