summaryrefslogtreecommitdiff
path: root/src/conn_info/mod.rs
diff options
context:
space:
mode:
authortcmal <me@aria.rip>2024-06-26 21:03:36 +0100
committertcmal <me@aria.rip>2024-06-26 21:51:48 +0100
commit6785d154460921cc3b774376a676a226402d8270 (patch)
tree865544599227908a77e0f6ef1b00e03ca382f567 /src/conn_info/mod.rs
parentf7f0df71657df790259f5358617901cf4142faf9 (diff)
add logging macros for debug mode only printing
Diffstat (limited to 'src/conn_info/mod.rs')
-rw-r--r--src/conn_info/mod.rs19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/conn_info/mod.rs b/src/conn_info/mod.rs
index 7ef6b5a..7bf09ba 100644
--- a/src/conn_info/mod.rs
+++ b/src/conn_info/mod.rs
@@ -6,7 +6,7 @@ use xcb::{
self, ChangeProperty, ChangeWindowAttributes, CreateWindow, DeleteProperty, DestroyWindow,
Window, WindowClass,
},
- Connection as RawConnection, Cookie, VoidCookieChecked,
+ Connection as RawConnection, VoidCookieChecked,
};
#[doc(hidden)]
@@ -24,7 +24,10 @@ pub use self::{
cursors::Cursors,
keys::KeyboardInfo,
};
-use crate::error::{Error, Result};
+use crate::{
+ debug_req,
+ error::{Error, Result},
+};
/// The connection, along with some cached resources required for WM operations.
pub struct Connection<'a> {
@@ -54,18 +57,6 @@ pub struct Connection<'a> {
pub keyboard_state: KeyboardInfo,
}
-/// Helper macro to log a request / cookie when `debug_assertions` are on
-macro_rules! debug_req {
- ($req:ident) => {
- #[cfg(debug_assertions)]
- eprintln!("seq ?: {:?}", $req)
- };
- ($req:ident, $cookie:ident) => {
- #[cfg(debug_assertions)]
- eprintln!("seq {}: {:?}", $cookie.sequence(), $req)
- };
-}
-
impl<'a> Connection<'a> {
/// Prepare the window manager to run on the given connection and screen number.
/// This will fail if another WM is running.