#async #logger #workload #github #light #heavily #containerized

async-rawlogger

Light console-only async logger. Suitable for containerized workloads. Heavily inspired by "https://github.com/nonconvextech/ftlog"

7 releases

new 0.1.20241101 Nov 1, 2024
0.1.20241024 Oct 24, 2024

#428 in Debugging

Download history 339/week @ 2024-10-07 229/week @ 2024-10-14 462/week @ 2024-10-21

1,030 downloads per month

MIT and AGPL-3.0

20KB
630 lines

use async_logger::{error, info, LevelFilter};

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
    initialize_logging().await;

    info!("starting...");

    Ok(())
}

async fn initialize_logging() {
    match async_logger::builder()
        .max_log_level(LevelFilter::Info)
        .bounded(100_000, false)
        .try_init()
    {
        Ok(_) => {}
        Err(e) => error!("{e}"),
    }
}

Dependencies

~3.5MB
~58K SLoC