loggix 1.0.4

A powerful, structured logging library for Rust inspired by Logrus. Features thread-safe logging, structured fields, custom formatters, and beautiful terminal output.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use loggix::{Fields, JSONFormatter, Logger};

fn main() {
    // Create a logger with JSON formatter
    let logger = Logger::new()
        .formatter(JSONFormatter::new().pretty(true))
        .build();

    // Log structured data that will be formatted as JSON
    logger
        .with_fields(Fields::new())
        .with_field("transaction_id", "tx-9876")
        .with_field("amount", 150.50)
        .with_field("currency", "USD")
        .with_field("status", "completed")
        .info("Payment processed")
        .unwrap();
}