log-assist

Crates.iolog-assist
lib.rslog-assist
version0.1.2
created_at2025-10-23 14:38:15.691081+00
updated_at2025-10-23 17:15:41.523608+00
descriptionAsync-friendly log assist lib for Seq (now), with pluggable sinks for rolling files (next).
homepagehttps://github.com/ikaranmali/log-assist-rs#
repositoryhttps://github.com/ikaranmali/log-assist-rs#
max_upload_size
id1897198
size63,985
karan mali (ikaranmali)

documentation

README

log-assist

A cargo crate library Async-friendly structured logger for Seq that automatically uses your Cargo project name, and safely reports panics (with file & line) even when the runtime is shutting down.


✨ Features

  • Async-friendly — Uses Tokio background task and buffered channel
  • Safe panic hook — Sends panic file, line, and message to Seq via blocking client (no runtime issues)
  • Non-blocking logs — Uses a background flush loop with configurable interval and queue size
  • Zero config for basic use — Just call seq::init() once

🚀 Quick Start

Add to Cargo.toml:

[dependencies]
log-assist = "0.1.1"
anyhow = "1.0"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }

Usage

cargo add log-assist
use log_assist::{seq,TimeMode,Config};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    seq::init(Config {
        application_name: "Log-Assist-Example".to_string().into(),
        endpoint: "http://localhost:5341".into(),
        api_key: None,
        queue_capacity: 10_000,
        flush_interval_ms: 1000,
        time_mode: TimeMode::Utc,
        enable_panic_hook: true
    }).await?;

    seq::info("Starting example", serde_json::json!({"env": "dev"})).await;
    seq::warn("Warning", serde_json::json!({"env": "dev"})).await;
    seq::error("Error", serde_json::json!({"env": "dev"})).await;
    panic!("Intentional panic test"); // shows panic hook behavior
}
Commit count: 0

cargo fmt