macro-log

Crates.iomacro-log
lib.rsmacro-log
version0.3.0
sourcesrc
created_at2023-08-11 08:14:20.508254
updated_at2023-10-15 09:49:50.861065
descriptionUse #[macro_log::debug] to log: 2023-08-11 15:52:59 - [D] - app/src/main.rs:3 -> called fn main()
homepagehttps://github.com/develon2015/macro-log
repositoryhttps://github.com/develon2015/macro-log
max_upload_size
id941675
size5,684
Develon (develon2015)

documentation

README

macro-log

install

$ cargo add macro-log

usage

use macro_log::*;

fn main() {
    let a = test1(0xff);
    i!("a = {a}");
    let b = test2(0xff);
    wtf!(b);
}

#[param]
fn test1(a: u32) -> u32 {
    a * 10
}

#[debug]
fn test2(a: u32) -> u32 {
    a * 100
}

output:

2023-08-14 12:29:41 - [D] - app\src\main.rs:10 -> call fn test1(a = 255)
2023-08-14 12:29:41 - [I] - app\src\main.rs:5 -> a = 2550
2023-08-14 12:29:41 - [D] - app\src\main.rs:15 -> called fn test2(a = 255) => 25500
2023-08-14 12:29:41 - [WTF] - app\src\main.rs:7 -> b = 25500
Commit count: 24

cargo fmt