dmacro

Crates.iodmacro
lib.rsdmacro
version0.1.9
sourcesrc
created_at2023-09-28 02:47:37.482927
updated_at2023-10-16 03:27:53.47546
descriptiondefine C-like debug trace macro: enter!() and leave!()
homepage
repositoryhttps://github.com/church6/dmacro
max_upload_size
id985491
size7,781
Church.ZHONG (church6)

documentation

README

Define C-like debug trace macro: enter!() and leave!().

Check crate: https://crates.io/crates/dmacro

Thanks to https://stackoverflow.com/questions/38088067.

Example

use dmacro::*;

fn main() {
    enter!();
    println!("Hello, world!");

    trace!();
    trace!("church11");
    trace!("church21", "church22",);
    trace!("church31", "church32", "church33");
    trace!("church31", "church32", "church33", 1024);
    let y = 2023;
    let m = 9;
    let d = 28;
    trace!(format!("{:04}-{:02}-{:02}", y, m, d));
    trace!(format!("{y:04}-{m:02}-{d:02}"));
    trace!(format!("{y:04}-{m:02}-{d:02}"), "enter");
    trace!(format!("{y:04}-{m:02}-{d:02}"), "leave");

    leave!();
}

More

Commit count: 19

cargo fmt