Crate advise

Source
Expand description

User-friendly status reporting.

This library provides a simple API for advising the end-user about program status to stderr.

§Usage

The primary use of the advise crate is through the five advising macros: error!, warn!, info!, debug!, and trace!, corresponding to the respective levels from the log crate.

Users can also implement their own custom message prefix formats by implementing Render on a struct (called a tag), then advising using advise!.

§Examples

use advise::{debug, error, info, trace, warn};

// Advise the user at various message levels
error!("It broke. Don't say you weren't warned!");
warn!("Are you sure you want to do that?");
info!("For your information...");
debug!("This should help you find the problem.");
trace!("Here's a really specific thing that happened...");

Produces:

error: It broke. Don't say you weren't warned!
warn: Are you sure you want to do that?
info: For your information...
debug: This should help you find the problem.
trace: Here's a really specific thing that happened...

Re-exports§

pub use anstream;
pub use log;

Macros§

advise
Prints advise to stderr.
debug
Advises about a debug message.
error
Advises about an error message.
info
Advises about an info message.
trace
Advises about a trace message.
warn
Advises about a warning message.

Structs§

Advise
Advisable tag and message.

Traits§

Render
Specifies how to render as a tag.