feat: add -v/-vv verbosity flags and trace-level hex dumps

Add clap CLI argument parsing with three log-level controls:
  -q/--quiet  errors only
  (default)   info — connections and value changes
  -v          debug — every packet's cmd/src/flags logged on TX and RX
  -vv         trace — full 32-byte hex dump of every packet on the wire

RUST_LOG env var continues to work as a fine-grained override for any
of the above levels.

Also expand the TX log line to include src and flags fields to match
the RX line, making the two symmetric.
This commit is contained in:
2026-04-10 14:56:12 -04:00
parent e83bc02563
commit 635a223fd5
3 changed files with 73 additions and 11 deletions
+6 -5
View File
@@ -10,8 +10,9 @@ name = "qmk-host"
path = "src/main.rs"
[dependencies]
hidapi = "2" # Cross-platform Raw HID access
anyhow = "1" # Ergonomic error handling
log = "0.4" # Logging facade
env_logger = "0.11" # Logger implementation (RUST_LOG env var)
ctrlc = "3" # Ctrl+C / SIGINT handler
hidapi = "2" # Cross-platform Raw HID access
anyhow = "1" # Ergonomic error handling
log = "0.4" # Logging facade
env_logger = "0.11" # Logger implementation (RUST_LOG env var)
ctrlc = "3" # Ctrl+C / SIGINT handler
clap = { version = "4", features = ["derive"] } # CLI argument parsing