#logging #cargo #message #style #stderr #warnings

carlog

Simple, lightweight crate that provides Cargo logging style messages

1 unstable release

0.1.0 Dec 10, 2021

#101 in #stderr

Download history 119/week @ 2025-12-28 287/week @ 2026-01-04 449/week @ 2026-01-11 264/week @ 2026-01-18 511/week @ 2026-01-25 275/week @ 2026-02-01 134/week @ 2026-02-08 266/week @ 2026-02-15 232/week @ 2026-02-22 201/week @ 2026-03-01 255/week @ 2026-03-08 230/week @ 2026-03-15 209/week @ 2026-03-22 184/week @ 2026-03-29 239/week @ 2026-04-05 264/week @ 2026-04-12

933 downloads per month
Used in 7 crates (4 directly)

MIT license

17KB
270 lines

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:

Compiled carlog v0.1.0

Dependencies

~0.1–10MB
~50K SLoC