diff --git a/rust/agama-server/src/web.rs b/rust/agama-server/src/web.rs index 68f5762e31..a0e2e5851d 100644 --- a/rust/agama-server/src/web.rs +++ b/rust/agama-server/src/web.rs @@ -56,6 +56,7 @@ mod ws; use agama_lib::{connection, error::ServiceError, http::Event}; use common::{IssuesService, ProgressService}; pub use config::ServiceConfig; +use event::log_event; pub use event::{EventsReceiver, EventsSender}; pub use service::MainServiceBuilder; use std::path::Path; @@ -189,10 +190,7 @@ async fn run_events_monitor(dbus: zbus::Connection, events: EventsSender) -> Res tokio::pin!(stream); let e = events.clone(); while let Some((_, event)) = stream.next().await { - match serde_json::to_string(&event) { - Ok(json) => tracing::info!("event: {json}"), - Err(_) => tracing::info!("event (not serialized): {:?}", &event), - } + log_event(&event); _ = e.send(event); } Ok(()) diff --git a/rust/agama-server/src/web/common/progress.rs b/rust/agama-server/src/web/common/progress.rs index 8be6d11a6d..7b123c2456 100644 --- a/rust/agama-server/src/web/common/progress.rs +++ b/rust/agama-server/src/web/common/progress.rs @@ -35,7 +35,7 @@ //! //! At this point, it only handles the progress that are exposed through D-Bus. -use crate::web::EventsSender; +use crate::web::{event::log_event, EventsSender}; use agama_lib::{ http::Event, progress::{Progress, ProgressSequence}, @@ -174,6 +174,7 @@ impl ProgressService { path: path.to_string(), progress, }; + log_event(&event); self.events.send(event)?; Ok(()) } diff --git a/rust/agama-server/src/web/event.rs b/rust/agama-server/src/web/event.rs index beb7611e33..d3a3f6f5bd 100644 --- a/rust/agama-server/src/web/event.rs +++ b/rust/agama-server/src/web/event.rs @@ -23,3 +23,11 @@ use tokio::sync::broadcast::{Receiver, Sender}; pub type EventsSender = Sender; pub type EventsReceiver = Receiver; + +pub fn log_event(event: &Event) { + tracing::info!("event(debug): {:?}", &event); + match serde_json::to_string(&event) { + Ok(json) => tracing::info!("event: {json}"), + Err(_) => tracing::info!("event (not serialized): {:?}", &event), + } +} diff --git a/rust/package/agama.changes b/rust/package/agama.changes index e1c7ad342f..3aa9fad5bd 100644 --- a/rust/package/agama.changes +++ b/rust/package/agama.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Jul 22 10:47:36 UTC 2025 - Imobach Gonzalez Sosa + +- Log ProgressChanged events (gh#agama-project/agama#2597). + ------------------------------------------------------------------- Tue Jul 22 07:53:34 UTC 2025 - Martin Vidner