trace_caller_macro

Crates.iotrace_caller_macro
lib.rstrace_caller_macro
version0.1.0
sourcesrc
created_at2020-03-21 02:51:42.404922
updated_at2020-03-21 02:51:42.404922
descriptionprocedural macro for tracing caller's source location (trace_caller)
homepage
repositoryhttps://github.com/ayushmishra2005/trace_caller
max_upload_size
id220857
size3,204
Ayush Mishra (ayushmishra2005)

documentation

README

trace_caller

Build Status Latest version MIT licensed Stability stable

This procedural attribute macro will allow retrieving the caller's source location in the stable Rust. Rust has also this feature, but it is currently unstable and available in nightly-only build. But with this attribute, you can use this feature on stable Rust.

It will help to trace the location of the caller of a function.

Example

use trace_caller::trace;

#[trace]
fn add(x: u32, y: u32) -> u32 {
    x + y
}

fn main() {
    let result = add(3, 4);
    println!("Result: {}", result);
}

Result

Called from "src/main.rs" at line 11
Result: 7
Commit count: 18

cargo fmt