tracing: Use don't log on hot paths without trace-level

This commit is contained in:
Victoria Brekenfeld 2023-03-03 19:34:41 +01:00
parent 9b416b5779
commit 3f462e3eb7
7 changed files with 20 additions and 20 deletions

View file

@ -12,7 +12,7 @@ use smithay::{
utils::{IsAlive, Serial, SERIAL_COUNTER},
};
use std::cell::RefCell;
use tracing::{debug, info};
use tracing::{debug, trace};
use self::target::{KeyboardFocusTarget, WindowGroup};
@ -101,7 +101,7 @@ impl Shell {
if let Some(workspace) = state.common.shell.space_for_mut(mapped) {
let mut focus_stack = workspace.focus_stack.get_mut(active_seat);
if Some(mapped) != focus_stack.last() {
debug!(?mapped, "Focusing window.");
trace!(?mapped, "Focusing window.");
focus_stack.append(mapped);
// also remove popup grabs, if we are switching focus
if let Some(mut popup_grab) = active_seat
@ -203,7 +203,7 @@ impl Common {
{
continue; // Focus is valid
} else {
debug!("Wrong Window, focus fixup");
trace!("Wrong Window, focus fixup");
}
}
KeyboardFocusTarget::LayerSurface(layer) => {
@ -224,7 +224,7 @@ impl Common {
} // Focus is valid
};
} else {
debug!("Surface dead, focus fixup");
trace!("Surface dead, focus fixup");
}
} else {
continue;
@ -263,7 +263,7 @@ impl Common {
.map(KeyboardFocusTarget::from)
});
if let Some(keyboard) = seat.get_keyboard() {
info!("Restoring focus to {:?}", target.as_ref());
debug!("Restoring focus to {:?}", target.as_ref());
keyboard.set_focus(state, target.clone(), SERIAL_COUNTER.next_serial());
ActiveFocus::set(&seat, target);
}

View file

@ -31,7 +31,7 @@ use smithay::{
wayland::seat::WaylandFocus,
};
use std::{borrow::Borrow, collections::HashMap, hash::Hash, sync::Arc};
use tracing::debug;
use tracing::trace;
mod grabs;
pub use self::grabs::*;
@ -421,7 +421,7 @@ impl TilingLayout {
});
// remove self
debug!(?mapped, "Remove window.");
trace!(?mapped, "Remove window.");
let _ = tree.remove_node(node_id.clone(), RemoveBehavior::DropChildren);
// fixup parent node
@ -434,7 +434,7 @@ impl TilingLayout {
if group.len() > 2 {
group.remove_window(position);
} else {
debug!("Removing Group");
trace!("Removing Group");
let other_child =
tree.children_ids(&id).unwrap().cloned().next().unwrap();
let fork_pos = parent_parent_id.as_ref().and_then(|parent_id| {