blob: b54dfdd0f2951d1485a09717666503ea8e63f63a (
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 when `debug_assertions` are on
#[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)
};
}
|