blob: 5be30d3e47a24087984e712a74aae05bf5878507 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
//! 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)
};
}
|