From a099ccbb2ef07dbde5af39c102ee5f86b68ed84a Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld Date: Wed, 19 Jan 2022 19:35:03 +0100 Subject: [PATCH] desktop.layer: Use a proper logger --- src/desktop/layer.rs | 16 ++++++++-------- src/wayland/output/mod.rs | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/desktop/layer.rs b/src/desktop/layer.rs index 1dc4b9a..e2f0ed5 100644 --- a/src/desktop/layer.rs +++ b/src/desktop/layer.rs @@ -29,6 +29,7 @@ pub struct LayerMap { layers: IndexSet, output: Weak<(Mutex, wayland_server::UserDataMap)>, zone: Rectangle, + logger: ::slog::Logger, } /// Retrieve a [`LayerMap`] for a given [`Output`]. @@ -53,6 +54,9 @@ pub fn layer_map_for_output(o: &Output) -> RefMut<'_, LayerMap> { .map(|mode| mode.size.to_logical(o.current_scale())) .unwrap_or_else(|| (0, 0).into()), ), + logger: (*o.inner.0.lock().unwrap()) + .log + .new(slog::o!("smithay_module" => "layer_map")), }) }); userdata.get::>().unwrap().borrow_mut() @@ -160,11 +164,7 @@ impl LayerMap { .unwrap_or_else(|| (0, 0).into()), ); let mut zone = output_rect; - slog::debug!( - crate::slog_or_fallback(None), - "Arranging layers into {:?}", - output_rect.size - ); + slog::trace!(self.logger, "Arranging layers into {:?}", output_rect.size); for layer in self.layers.iter() { let surface = if let Some(surface) = layer.get_surface() { @@ -233,8 +233,8 @@ impl LayerMap { } } - slog::debug!( - crate::slog_or_fallback(None), + slog::trace!( + self.logger, "Setting layer to pos {:?} and size {:?}", location, size @@ -253,7 +253,7 @@ impl LayerMap { layer_state(layer).location = location; } - slog::debug!(crate::slog_or_fallback(None), "Remaining zone {:?}", zone); + slog::trace!(self.logger, "Remaining zone {:?}", zone); self.zone = zone; } } diff --git a/src/wayland/output/mod.rs b/src/wayland/output/mod.rs index fdfba5e..30620e5 100644 --- a/src/wayland/output/mod.rs +++ b/src/wayland/output/mod.rs @@ -102,7 +102,7 @@ pub struct PhysicalProperties { #[derive(Debug)] pub(crate) struct Inner { name: String, - log: ::slog::Logger, + pub(crate) log: ::slog::Logger, instances: Vec, physical: PhysicalProperties, location: Point,