Skip to main content

grp_core/system/
code.rs

1
2#[macro_export]
3/// Returns a string with the current source code location
4/// 
5/// > Returns something like `"src/main.rs:10:5"`
6/// 
7/// This macro formats the current file name, 
8/// line number and column number
9/// into a single string in the 
10/// format *file:line:column*
11///
12/// # Examples
13/// 
14/// ```rust
15/// use grp_core::location;
16/// 
17/// let loc = location!();
18/// ```
19macro_rules! location {
20    () => {
21        format!("{}:{}:{}", file!(), line!(), column!())
22    };
23}