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§

Macros§

Structs§

  • Advisable tag and message.

Traits§

  • Specifies how to render as a tag.