#logger #async #info #error #workload #light #level-filter

async-rawlogger

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

3 releases

new 0.1.20241016 Oct 16, 2024
0.1.20241011 Oct 11, 2024
0.1.20241008 Oct 8, 2024

#491 in Debugging

Download history 89/week @ 2024-10-02 259/week @ 2024-10-09

348 downloads per month

MIT and AGPL-3.0

27KB
538 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