3 releases

0.1.2 Jul 24, 2024
0.1.1 Mar 8, 2024
0.1.0 Mar 4, 2024

#41 in #info

MIT license

22KB
285 lines

🗃️ A simple log library, similar to leg, but with macros

Thanks to jesusprubio for the idea

  • Prints to stderr
  • NO_COLOR is not supported (you can change it)

Example

use hand::*;

fn main() {
    // Basic usage
    infoln!("This is an info message");
    warnln!("This is a warning message");
    errorln!("This is an error message");

    // Without new line
    info!("Scanning dogs ... ");
    successln!("complete");

    // With scope
    scopeinfoln!("scope", "Some message with a scope");

    // Support formatting!
    let error_msg = "file not found";
    scopeerrorln!("critical", "Critical error: {}", error_msg);

    infoln!("Continuing in {} seconds", 3);
    waitln!("Cooldown {} seconds", std::time::Duration::from_millis(3000).as_secs());
}

Terminal output

usage example

Dependencies

~0–9.5MB
~43K SLoC