trace_macros::TRACE!
[−]
[src]
macro_rules! 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!()); }}; }
Trace macro which concats passed arguments into one string.
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!()
Arguments must have fmt::Display
trait.