1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-04-19 19:34:24 +02:00

chore(system tray): add debug logging

This commit is contained in:
Jake Stanger 2023-04-16 19:55:17 +01:00
parent 1e1d65ae49
commit 8e99fd4d0f
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61

View file

@ -10,7 +10,7 @@ use stray::message::{NotifierItemCommand, NotifierItemMessage};
use stray::StatusNotifierWatcher;
use tokio::spawn;
use tokio::sync::{broadcast, mpsc};
use tracing::error;
use tracing::{debug, error, trace};
type Tray = BTreeMap<String, (Box<StatusNotifierItem>, Option<TrayMenu>)>;
@ -38,6 +38,8 @@ impl TrayEventReceiver {
spawn(async move {
while let Ok(message) = host.recv().await {
trace!("Received message: {message:?} ");
send!(b_tx, message.clone());
let mut tray = lock!(tray);
match message {
@ -46,9 +48,11 @@ impl TrayEventReceiver {
item,
menu,
} => {
debug!("Adding item with address '{address}'");
tray.insert(address, (item, menu));
}
NotifierItemMessage::Remove { address } => {
debug!("Removing item with address '{address}'");
tray.remove(&address);
}
}