spacex_log

Crates.iospacex_log
lib.rsspacex_log
version0.1.1
sourcesrc
created_at2023-09-20 08:02:15.334969
updated_at2023-09-20 08:05:40.013374
descriptionlog formater with env_logger
homepage
repositoryhttps://github.com/jiawei397/spacex_log
max_upload_size
id977899
size17,725
jia wei (jiawei397)

documentation

https://docs.rs/spacex_log

README

spacex_log

One log formatter with env_logger.

Example

Run as cargo run --example simple.

use log::{debug, error, info, warn};
use spacex_log::init_log;

fn main() {
    init_log("INFO");
    // init_log("info");

    debug!("debug info");

    info!("test info");

    warn!("warn info");

    error!("error");
}

Then logs:

2023-09-20 15:23:17 [INFO] [simple]: test info
2023-09-20 15:23:17 [WARN] [simple]: warn info
2023-09-20 15:23:17 [ERROR] [simple]: error

If you want to disable log colors, you can set the env NO_COLOR to true.

Commit count: 8

cargo fmt