Crate carlog

Source
Expand description

carlog is a simple, lightweight crate that provides Cargo logging style messages via the Status struct or via multiple macros that recreate common cargo message formats:

  • Cargo ok: carlog_ok!
  • Cargo info: carlog_info!
  • Cargo warning: carlog_warning!
  • Cargo error: carlog_error!

The crate provides support for logging to both stdout and stderr and to any stream that implements the Write trait.

§Example

#[macro_use] extern crate carlog;

use carlog::prelude::*;

let status = Status::new().bold().justify().color(CargoColor::Green).status("Compiled");
status.print_stdout("carlog v0.1.0");

carlog_ok!("Compiled", "carlog v0.1.0");

Output:

Compiled carlog v0.1.0

Modules§

prelude
Module to import required structs and enums to use this crate.

Macros§

carlog
Print a cargo like message.
carlog_error
Print an error like cargo message.
carlog_info
Print an info-like cargo message.
carlog_ok
Print an ok-like cargo message.
carlog_warning
Print an warning like cargo message.

Structs§

Status
Simple cargo status log.

Enums§

CargoColor
Cargo terminal colors.
CarlogStream
Carlog library streams.