code_logger 0.1.0

A simple, colorful, and flexible logging library for Rust with timestamps, log levels, and custom error codes.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
mod logger;
use logger::log;

fn main() {
    // Using builder
    log("Hello, world!".to_string())
        .timestamp()
        .code(42)
        .info()   // builds the Logger
        .print(); // actually prints it

    // Or directly
    let logger = log("Something went wrong".to_string())
        .code(404)
        .error(); // builds Logger

    logger.print(); // prints it
}