logflume

Crates.iologflume
lib.rslogflume
version0.0.6
sourcesrc
created_at2024-04-08 20:27:38.011719
updated_at2024-05-10 11:02:59.325695
descriptionA low latency logging library 🪵.
homepage
repositoryhttps://github.com/SBentley/logflume
max_upload_size
id1201179
size42,209
Sam Bentley (SBentley)

documentation

README

Low latency logging library for Rust 🪵

Example

use logflume::{info, Level};
use std::fs;

fn main() {
    logflume::Logger::new()
        .level(Level::Debug)
        .cpu(2)
        .file("my-log-file.log")
        .init()
        .expect("Unable to construct logger");

    for i in 1..1_000_001 {
        info!("number {}", i);
    }
    logflume::logger().flush();
}

logflume is an asynchronous logger, it hands of all the formatting and writing of logs to another thread to minimize latency on the calling thread. A blocking call to logflume::logger::flush() is needed if you want to wait for all log messages to be processed, it is advisable to do this before the program shuts down to guarantee that all logs are persisted.

Commit count: 49

cargo fmt