Crate print_run

Source
Expand description

A procedural macro crate for tracing Rust function and module execution — with style.

print-run provides #[print_run] attribute macro that automatically logs when functions start and finish, with optional color, duration, nested indentation, timestamps and more.

It’s ideal for skeletons, debugging, quick prototypes, educational examples, or even just fun visual feedback.

§Features

  • Supports standalone functions, impl blocks, and inline mods
  • Logs entry and exit of functions
  • Draws visual call hierarchy (indents nested calls)
  • Measures and displays execution duration
  • Supports async functions
  • Optional color and timestamps
  • msg!() macro for indented, bold println!-style output

§Usage

Apply #[print_run] to any function:

use print_run::print_run;

#[print_run]
fn demo() {
    msg!("Running...");
}

Use #[print_run_defaults(...)] to set global options for the crate:

#[print_run_defaults(indent, colored)]
§For more, see the crate README.

§License

Licensed under MIT.

Attribute Macros§

print_run
Procedural macro to automatically log function entry and exit.
print_run_defaults
Attribute macro to define global defaults for #[print_run(...)].