Skip to content
Snippets Groups Projects
Commit 9361acad authored by Jason Volk's avatar Jason Volk Committed by 🥺
Browse files

add debug log level macros.


Signed-off-by: default avatarJason Volk <jason@zemos.net>
parent 1e0b3436
No related branches found
No related tags found
No related merge requests found
/// Log message at the ERROR level in debug-mode (when debug-assertions are
/// enabled). In release mode it becomes DEBUG level, and possibly subject to
/// elision.
#[macro_export]
macro_rules! debug_error {
( $($x:tt)+ ) => {
if cfg!(debug_assertions) {
error!( $($x)+ );
} else {
debug!( $($x)+ );
}
}
}
/// Log message at the WARN level in debug-mode (when debug-assertions are
/// enabled). In release mode it becomes DEBUG level, and possibly subject to
/// elision.
#[macro_export]
macro_rules! debug_warn {
( $($x:tt)+ ) => {
if cfg!(debug_assertions) {
warn!( $($x)+ );
} else {
debug!( $($x)+ );
}
}
}
/// Log message at the INFO level in debug-mode (when debug-assertions are
/// enabled). In release mode it becomes DEBUG level, and possibly subject to
/// elision.
#[macro_export]
macro_rules! debug_info {
( $($x:tt)+ ) => {
if cfg!(debug_assertions) {
info!( $($x)+ );
} else {
debug!( $($x)+ );
}
}
}
pub(crate) mod debug;
pub(crate) mod error; pub(crate) mod error;
use std::{ use std::{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment