Skip to content

A simple color-coded logging implementation for the standard rust logging system

License

Notifications You must be signed in to change notification settings

CugeDe/rust-colog

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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()
{
    drop(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:

terminal example

Known issues and improvements

The color and terminal handling could use a serious improvement, via one of the nice terminal crates available now.

Patches welcome :)

License

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

About

A simple color-coded logging implementation for the standard rust logging system

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%