#log #formatter #logging #backend #system #patch

colog

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

6 releases (3 stable)

1.2.0 Mar 4, 2023
1.1.0 Sep 13, 2021
1.0.0 Feb 12, 2020
0.2.1 Feb 20, 2019
0.1.1 Apr 26, 2017

#41 in Value formatting

Download history 40/week @ 2022-11-27 60/week @ 2022-12-04 50/week @ 2022-12-11 47/week @ 2022-12-18 26/week @ 2022-12-25 15/week @ 2023-01-01 278/week @ 2023-01-08 59/week @ 2023-01-15 51/week @ 2023-01-22 167/week @ 2023-01-29 74/week @ 2023-02-05 143/week @ 2023-02-12 362/week @ 2023-02-19 1082/week @ 2023-02-26 273/week @ 2023-03-05 29/week @ 2023-03-12

1,768 downloads per month
Used in 3 crates

LGPL-3.0

24KB
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

~1.2–1.6MB
~44K SLoC