desktop.layer: Use a proper logger

This commit is contained in:
Victoria Brekenfeld 2022-01-19 19:35:03 +01:00
parent a5efee5c21
commit a099ccbb2e
2 changed files with 9 additions and 9 deletions

View File

@ -29,6 +29,7 @@ pub struct LayerMap {
layers: IndexSet<LayerSurface>, layers: IndexSet<LayerSurface>,
output: Weak<(Mutex<OutputInner>, wayland_server::UserDataMap)>, output: Weak<(Mutex<OutputInner>, wayland_server::UserDataMap)>,
zone: Rectangle<i32, Logical>, zone: Rectangle<i32, Logical>,
logger: ::slog::Logger,
} }
/// Retrieve a [`LayerMap`] for a given [`Output`]. /// 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())) .map(|mode| mode.size.to_logical(o.current_scale()))
.unwrap_or_else(|| (0, 0).into()), .unwrap_or_else(|| (0, 0).into()),
), ),
logger: (*o.inner.0.lock().unwrap())
.log
.new(slog::o!("smithay_module" => "layer_map")),
}) })
}); });
userdata.get::<RefCell<LayerMap>>().unwrap().borrow_mut() userdata.get::<RefCell<LayerMap>>().unwrap().borrow_mut()
@ -160,11 +164,7 @@ impl LayerMap {
.unwrap_or_else(|| (0, 0).into()), .unwrap_or_else(|| (0, 0).into()),
); );
let mut zone = output_rect; let mut zone = output_rect;
slog::debug!( slog::trace!(self.logger, "Arranging layers into {:?}", output_rect.size);
crate::slog_or_fallback(None),
"Arranging layers into {:?}",
output_rect.size
);
for layer in self.layers.iter() { for layer in self.layers.iter() {
let surface = if let Some(surface) = layer.get_surface() { let surface = if let Some(surface) = layer.get_surface() {
@ -233,8 +233,8 @@ impl LayerMap {
} }
} }
slog::debug!( slog::trace!(
crate::slog_or_fallback(None), self.logger,
"Setting layer to pos {:?} and size {:?}", "Setting layer to pos {:?} and size {:?}",
location, location,
size size
@ -253,7 +253,7 @@ impl LayerMap {
layer_state(layer).location = location; 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; self.zone = zone;
} }
} }

View File

@ -102,7 +102,7 @@ pub struct PhysicalProperties {
#[derive(Debug)] #[derive(Debug)]
pub(crate) struct Inner { pub(crate) struct Inner {
name: String, name: String,
log: ::slog::Logger, pub(crate) log: ::slog::Logger,
instances: Vec<WlOutput>, instances: Vec<WlOutput>,
physical: PhysicalProperties, physical: PhysicalProperties,
location: Point<i32, Logical>, location: Point<i32, Logical>,