#log #logging #formatter #backend #logger #system #standard #crate #colored #in

colog

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

4 releases (1 stable)

✓ Uses Rust 2018 edition

1.0.0 Feb 12, 2020
0.2.1 Feb 20, 2019
0.2.0 Feb 20, 2019
0.1.1 Apr 26, 2017

#22 in Value formatting

34 downloads per month

LGPL-3.0

23KB
65 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

#[macro_use]
extern crate log;
extern crate colog;

fn main()
{
    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

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

~2MB
~49K SLoC