mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-07-01 10:41:03 +02:00
chore(system tray): add debug logging
This commit is contained in:
parent
1e1d65ae49
commit
8e99fd4d0f
1 changed files with 5 additions and 1 deletions
|
@ -10,7 +10,7 @@ use stray::message::{NotifierItemCommand, NotifierItemMessage};
|
||||||
use stray::StatusNotifierWatcher;
|
use stray::StatusNotifierWatcher;
|
||||||
use tokio::spawn;
|
use tokio::spawn;
|
||||||
use tokio::sync::{broadcast, mpsc};
|
use tokio::sync::{broadcast, mpsc};
|
||||||
use tracing::error;
|
use tracing::{debug, error, trace};
|
||||||
|
|
||||||
type Tray = BTreeMap<String, (Box<StatusNotifierItem>, Option<TrayMenu>)>;
|
type Tray = BTreeMap<String, (Box<StatusNotifierItem>, Option<TrayMenu>)>;
|
||||||
|
|
||||||
|
@ -38,6 +38,8 @@ impl TrayEventReceiver {
|
||||||
|
|
||||||
spawn(async move {
|
spawn(async move {
|
||||||
while let Ok(message) = host.recv().await {
|
while let Ok(message) = host.recv().await {
|
||||||
|
trace!("Received message: {message:?} ");
|
||||||
|
|
||||||
send!(b_tx, message.clone());
|
send!(b_tx, message.clone());
|
||||||
let mut tray = lock!(tray);
|
let mut tray = lock!(tray);
|
||||||
match message {
|
match message {
|
||||||
|
@ -46,9 +48,11 @@ impl TrayEventReceiver {
|
||||||
item,
|
item,
|
||||||
menu,
|
menu,
|
||||||
} => {
|
} => {
|
||||||
|
debug!("Adding item with address '{address}'");
|
||||||
tray.insert(address, (item, menu));
|
tray.insert(address, (item, menu));
|
||||||
}
|
}
|
||||||
NotifierItemMessage::Remove { address } => {
|
NotifierItemMessage::Remove { address } => {
|
||||||
|
debug!("Removing item with address '{address}'");
|
||||||
tray.remove(&address);
|
tray.remove(&address);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue