colog 0.1.1

The `colog` library is a simple formatter backend for the standard rust logging system (in the `log` crate).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use log;
use log::LogLevel;
use colored::*;

#[allow(dead_code)]
pub fn level_color(level: &log::LogLevel, msg: &str) -> String
{
    match level
    {
        &LogLevel::Error => msg.red(),
        &LogLevel::Warn  => msg.yellow(),
        &LogLevel::Info  => msg.green(),
        &LogLevel::Debug => msg.green(),
        &LogLevel::Trace => msg.magenta(),
    }.bold().to_string()
}