From 8e99fd4d0f01cf4406cabf19fb635f03447753c8 Mon Sep 17 00:00:00 2001 From: Jake Stanger Date: Sun, 16 Apr 2023 19:55:17 +0100 Subject: [PATCH] chore(system tray): add debug logging --- src/clients/system_tray.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/clients/system_tray.rs b/src/clients/system_tray.rs index a494a10..a511280 100644 --- a/src/clients/system_tray.rs +++ b/src/clients/system_tray.rs @@ -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, Option)>; @@ -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); } }