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
use loggix::with_error;
use std::fs::File;
use std::io::Error;

fn main() {
    // Example 1: Logging a file error
    let result = File::open("non_existent.txt");
    if let Err(error) = result {
        with_error(&error).error("Failed to open file").unwrap();
    }

    // Example 2: Custom error
    let custom_error = Error::new(std::io::ErrorKind::Other, "Database connection failed");
    with_error(&custom_error)
        .error("Database error occurred")
        .unwrap();
}