2 releases

0.1.1 Sep 20, 2023
0.1.0 Sep 20, 2023

#548 in Debugging

Download history 2/week @ 2024-02-20 13/week @ 2024-02-27 54/week @ 2024-03-19 6/week @ 2024-03-26 20/week @ 2024-04-02

80 downloads per month

MIT license

6KB

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.

Dependencies

~4–6MB
~97K SLoC