#logging #terminal-logging #cli #terminal

colog

The colog library is a simple formatter backend for the standard rust logging system (in the log crate)

8 releases (5 stable)

Uses new Rust 2024

1.4.0 Sep 12, 2025
1.3.0 Mar 23, 2024
1.2.0 Mar 4, 2023
1.1.0 Sep 13, 2021
0.1.1 Apr 26, 2017

#62 in Command-line interface

Download history 2455/week @ 2025-08-29 2866/week @ 2025-09-05 3341/week @ 2025-09-12 3883/week @ 2025-09-19 4696/week @ 2025-09-26 4762/week @ 2025-10-03 4752/week @ 2025-10-10 4061/week @ 2025-10-17 3652/week @ 2025-10-24 3053/week @ 2025-10-31 3145/week @ 2025-11-07 3482/week @ 2025-11-14 2626/week @ 2025-11-21 2579/week @ 2025-11-28 3223/week @ 2025-12-05 1671/week @ 2025-12-12

10,744 downloads per month
Used in 64 crates (50 directly)

LGPL-3.0

29KB
102 lines

Simple colored logger for rust

The colog library is a simple formatter backend for the standard rust logging system (in the log crate).

Getting started

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

fn main() {
    // Quick start: use default initialization
    colog::init();

    error!("error message");
    error!("error with fmt: {}", 42);
    warn!("warn message");
    info!("info message");
    debug!("debug message");
    trace!("trace message");

    info!("multi line demonstration\nhere");
    info!("more\nmulti\nline\nhere\nhere");
}

This results in the following terminal output:

demo screenshot from terminal

Custom styling

It's possible to override all colors and styles of colog.

See the following examples:

Also be sure to read the documentation (cargo doc --open) for a detailed description.

Known issues and improvements

There are no known, serious, unsolved issues.

Patches welcome :)

License

This project is licensed under the LGPLv3. See the file LICENSE for details.

Dependencies

~0.3–9.5MB
~52K SLoC