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

colog

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

5 releases (2 stable)

1.1.0 Sep 13, 2021
1.0.0 Feb 12, 2020
0.2.1 Feb 20, 2019
0.2.0 Feb 20, 2019
0.1.1 Apr 26, 2017

#30 in Value formatting

39 downloads per month
Used in iron-oxide

LGPL-3.0

23KB
64 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
~47K SLoC