fix(volume): log initial volume level at INFO on startup

Volume changes were only logged at DEBUG (requires -v), leaving the
volume monitor completely silent at the default log level. The first
reading is now logged at INFO so users can confirm the monitor is
running and see the current level without needing verbose output.
This commit is contained in:
2026-04-10 16:47:25 -04:00
parent bd4facf1c4
commit 4e33e67e96
+6 -2
View File
@@ -17,7 +17,7 @@ use std::process::Command;
use std::thread;
use std::time::Duration;
use log::{debug, error, warn};
use log::{debug, error, info, warn};
use crate::keyboard::Keyboard;
use crate::protocol::{Packet, DEV_HOST};
@@ -34,7 +34,11 @@ pub fn monitor(keyboards: Vec<Keyboard>) {
match query_volume() {
Some(vol) if last != Some(vol) => {
debug!("Volume changed: {}%", vol);
if last.is_none() {
info!("Volume monitor started: {}%", vol);
} else {
debug!("Volume changed: {}%", vol);
}
last = Some(vol);
broadcast(Packet::volume(DEV_HOST, vol), &keyboards);
}