1 unstable release

0.1.0 Apr 21, 2024

#713 in Rust patterns

Download history 6/week @ 2024-02-12 25/week @ 2024-02-19 7/week @ 2024-02-26 5/week @ 2024-04-01 139/week @ 2024-04-15 48/week @ 2024-04-22

192 downloads per month

MIT/Apache

12KB
98 lines

advise

latest version dependency status documentation license

About

This crate offers a streamlined way to keep users informed about your program's progress and potential issues. It provides:

  • Convenience macros: Advise at familiar logging levels error!, warn!, info!, debug!, and trace! to categorize your messages.
  • Customizable tags: Design your own message tags using the Render trait, tailoring the specific needs to your application.

Usage

advise provides a simple API, similar to the log crate, for printing status messages that should be enough for the majority of use-cases.

use advise::{info, warn};

fn main() {
    warn!("It's dangerous to go alone!");
    info!("Take this.");
}

Running the above code will print the following to stderr.

warn: It's dangeous to go alone!
info: Take this.

[!IMPORTANT]

GitHub currently does not support coloured text in markdown. You can run this example with cargo run --example=basic to see the above output rendered in colour.

License

This project is dual-licensed under both MIT License and Apache License 2.0. You have permission to use this code under the conditions of either license pursuant to the rights granted by the chosen license.

Dependencies

~300KB