refactor(wm): reduce noise in info and error logs

This commit is contained in:
LGUG2Z
2024-05-09 19:49:43 -07:00
parent 4802b55452
commit 11acff5236
2 changed files with 5 additions and 7 deletions
+4 -6
View File
@@ -14,7 +14,6 @@ use komorebi_core::config_generation::MatchingRule;
use komorebi_core::config_generation::MatchingStrategy; use komorebi_core::config_generation::MatchingStrategy;
use regex::Regex; use regex::Regex;
use schemars::JsonSchema; use schemars::JsonSchema;
use serde::ser::Error;
use serde::ser::SerializeStruct; use serde::ser::SerializeStruct;
use serde::Deserialize; use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
@@ -97,24 +96,23 @@ impl Serialize for Window {
"title", "title",
&self &self
.title() .title()
.map_err(|_| S::Error::custom("could not get window title"))?, .unwrap_or_else(|_| String::from("could not get window title")),
)?; )?;
state.serialize_field( state.serialize_field(
"exe", "exe",
&self &self
.exe() .exe()
.map_err(|_| S::Error::custom("could not get window exe"))?, .unwrap_or_else(|_| String::from("could not get window exe")),
)?; )?;
state.serialize_field( state.serialize_field(
"class", "class",
&self &self
.class() .class()
.map_err(|_| S::Error::custom("could not get window class"))?, .unwrap_or_else(|_| String::from("could not get window class")),
)?; )?;
state.serialize_field( state.serialize_field(
"rect", "rect",
&WindowsApi::window_rect(self.hwnd()) &WindowsApi::window_rect(self.hwnd()).unwrap_or_default(),
.map_err(|_| S::Error::custom("could not get window rect"))?,
)?; )?;
state.end() state.end()
} }
+1 -1
View File
@@ -566,7 +566,7 @@ impl WindowManager {
target_workspace_idx: usize, target_workspace_idx: usize,
to_move: &mut Vec<EnforceWorkspaceRuleOp>, to_move: &mut Vec<EnforceWorkspaceRuleOp>,
) -> () { ) -> () {
tracing::info!( tracing::trace!(
"{} should be on monitor {}, workspace {}", "{} should be on monitor {}, workspace {}",
window_title, window_title,
target_monitor_idx, target_monitor_idx,