1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-08-17 23:01:04 +02:00

chore: add trace logging to volume module

This commit is contained in:
Jake Stanger 2025-03-24 11:51:26 +00:00
parent 5a7ad5675d
commit 76ca6115a3
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61
4 changed files with 30 additions and 3 deletions

View file

@ -12,6 +12,7 @@ use gtk::{Button, CellRendererText, ComboBoxText, Label, Orientation, Scale, Tog
use serde::Deserialize;
use std::collections::HashMap;
use tokio::sync::mpsc;
use tracing::trace;
#[derive(Debug, Clone, Deserialize)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
@ -159,12 +160,16 @@ impl Module<Button> for VolumeModule {
sinks.iter().cloned().collect::<Vec<_>>()
};
trace!("initial syncs: {sinks:?}");
let inputs = {
let inputs = client.sink_inputs();
let inputs = lock!(inputs);
inputs.iter().cloned().collect::<Vec<_>>()
};
trace!("initial inputs: {inputs:?}");
for sink in sinks {
send_async!(tx, ModuleUpdateEvent::Update(Event::AddSink(sink)));
}
@ -178,6 +183,7 @@ impl Module<Button> for VolumeModule {
// recv loop
while let Ok(event) = rx.recv().await {
trace!("received event: {event:?}");
send_async!(tx, ModuleUpdateEvent::Update(event));
}
});