mirror of
https://git.meli.delivery/meli/meli
synced 2024-11-10 19:10:57 +00:00
add literal print to debug!
This commit is contained in:
parent
99527f5684
commit
325bb5bff2
@ -22,6 +22,21 @@
|
||||
pub mod dbg {
|
||||
#[macro_export]
|
||||
macro_rules! debug {
|
||||
($val:literal) => {
|
||||
if cfg!(debug_assertions) {
|
||||
eprint!(
|
||||
"[{:?}] {}:{}_{}: ",
|
||||
std::thread::current()
|
||||
.name()
|
||||
.map(|v| v.to_string())
|
||||
.unwrap_or_else(|| format!("{:?}", std::thread::current().id())),
|
||||
file!(),
|
||||
line!(),
|
||||
column!()
|
||||
);
|
||||
eprintln!($val);
|
||||
}
|
||||
};
|
||||
($val:expr) => {
|
||||
if cfg!(debug_assertions) {
|
||||
eprint!(
|
||||
|
Loading…
Reference in New Issue
Block a user