trace_macros::th_trace!
[−]
[src]
macro_rules! th_trace { (type=>$tp:expr, $($arg:tt)+) => {{ th_trace!("{}: {}", $tp, format_args!($($arg)+)); }}; (type=>$tp:expr) => {{ th_trace!("{}", $tp); }}; ($($arg:tt)+) => {{ println!("{}", format_args!("[{}] {}:{} - {}", std::thread::current().name().unwrap_or("none"), file!(), line!(), format_args!($($arg)+))); }}; }
Thread trace macro like println
It uses format_args!
for creating formatted string from passed arguments.
Prints with the following format: [thread_name] file!:line! - [type:] [Message]