colog

Crates.iocolog
lib.rscolog
version1.3.0
sourcesrc
created_at2017-04-26 18:33:59.335491
updated_at2024-03-23 09:36:11.415474
descriptionThe `colog` library is a simple formatter backend for the standard rust logging system (in the `log` crate).
homepagehttps://github.com/chrivers/rust-colog
repository
max_upload_size
id12124
size53,308
Christian Iversen (chrivers)

documentation

README

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.

Commit count: 0

cargo fmt