carlog 0.1.0

Simple, lightweight crate that provides Cargo logging style messages
Documentation
  • Coverage
  • 66.67%
    18 out of 27 items documented11 out of 12 items with examples
  • Size
  • Source code size: 19.58 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.16 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • PauMAVA/carlog
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • PauMAVA

carlog

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.

Import

Add the following line to your Cargo.toml:

carlog = "0.1.0"

Then import the prelude and the macros in your source file:

#[macro_use] extern crate carlog;

use carlog::prelude::*;

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: