trace_macros::DEBUG_TRACE!
[−]
[src]
macro_rules! DEBUG_TRACE { (type=>$tp:expr, sep=>$sep:expr, $msg:expr) => {{ println!("{}:{} - {}: {:?}", file!(), line!(), $tp, $msg); }}; (type=>$tp:expr, sep=>$sep:expr, $($arg:expr),+) => {{ println!("{}:{} - {}: {}", file!(), line!(), $tp, [$(format!("{:?}", $arg),)+].connect($sep)); }}; (type=>$tp:expr, $msg:expr) => {{ println!("{}:{} - {}: {:?}", file!(), line!(), $tp, $msg); }}; (type=>$tp:expr, $($arg:expr),+) => {{ println!("{}:{} - {}: {}", file!(), line!(), $tp, [$(format!("{:?}", $arg),)+].connect(" ")); }}; (type=>$tp:expr) => {{ println!("{}:{} - {}", file!(), line!(), $tp); }}; (sep=>$sep:expr, $($arg:expr),+) => {{ println!("{}:{} - {}", file!(), line!(), [$(format!("{:?}", $arg),)+].connect($sep)); }}; ($msg:expr) => {{ println!("{}:{} - {:?}", file!(), line!(), $msg); }}; ($($arg:expr),+) => {{ println!("{}:{} - {}", file!(), line!(), [$(format!("{:?}", $arg),)+].connect(" ")); }}; () => {{ println!("{}:{}", file!(), line!()); }}; }
Debug trace macro like TRACE!
Prints with the following format: file!:line! - [type:] [Message]
Usage:
TRACE!(type=>[TYPE], sep=>[String], [arg1, arg2, ..., argN])
TRACE!(type=>[TYPE], [arg1, arg2, ..., argN])
TRACE!(sep=>[String], [arg1, arg2, ..., argN])
TRACE!([arg1, arg2, ..., argN])
TRACE!()
It is the same as TRACE!
except that it prints with fmt::Debug
trait.