#log #cli #cli-color #tool #info #style #warn

bin+lib cli_color_log

A convenient color log tool for cli

2 releases

0.1.1 Feb 9, 2020
0.1.0 Feb 8, 2020

#17 in #cli-color

MIT license

5KB
74 lines

cli_color_log

A convenient color log tool for cli.

usage

use cli_color_log::Logger;
use cli_color_log::LogType;

fn main() {
    let logger = Logger::new(12);
    logger.info("This is a info message.");
    logger.warn("This is a warning message.");
    logger.error("This is a error message.");
    logger.style_log(LogType::Info, "Download", "This is a custom style message.");
    logger.style_log(LogType::Plain, "Console", "This is a plain style message.");
    logger.log("This is a plain log message.");
}

lib.rs:

cli_color_log

A convenient color log tool for cli.

usage

use cli_color_log::Logger;
use cli_color_log::LogType;

let logger = Logger::new(12);
logger.info("This is a info message.");
logger.warn("This is a warning message.");
logger.error("This is a error message.");
logger.style_log(LogType::Info, "Download", "This is a custom style message.");
logger.style_log(LogType::Plain, "Console", "This is a plain style message.");
logger.log("This is a plain log message.");

Dependencies

~3.5–5MB
~75K SLoC