//! Helper macros for logging /// Log to standard error, only compiled when in debug mode. #[macro_export] macro_rules! debug { ($($e:expr),*) => { #[cfg(debug_assertions)] { eprintln!($($e),*); } }; } /// Log a request / cookie when `debug_assertions` are on #[macro_export] macro_rules! debug_req { ($req:ident) => { $crate::debug!("seq ?: {:?}", $req) }; ($req:ident, $cookie:ident) => { use xcb::Cookie; $crate::debug!("seq {}: {:?}", $cookie.sequence(), $req) }; }