[feature] short name: only returns the function name
This commit is contained in:
parent
ec277110e5
commit
e63189514f
@ -14,6 +14,15 @@ macro_rules! function_name {
|
|||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Only get the function name itself, not the full qualifier
|
||||||
|
#[macro_export]
|
||||||
|
macro_rules! function_name_short {
|
||||||
|
() => {{
|
||||||
|
let name = function_name!();
|
||||||
|
name.split("::").last().unwrap()
|
||||||
|
}};
|
||||||
|
}
|
||||||
|
|
||||||
/// Like [`println!`] but also prints the current function name (including module path) and line.
|
/// Like [`println!`] but also prints the current function name (including module path) and line.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
|
Loading…
x
Reference in New Issue
Block a user