Module logger

Module logger 

Source
Expand description

A simple, zero-setup logger. A simple, “zero-setup” logger that works out-of-the-box.

This module provides a set of functions for logging messages at different levels (info, warn, error, debug). It automatically initializes on the first log call and respects the RUST_LOG environment variable.

§Example

use tincre_logger::logger;

fn main() {
    logger::info("Server has started.");
    logger::warn("Low disk space detected.");
    logger::error("Failed to connect to database!");
    // To see debug messages, run with `RUST_LOG=debug`
    logger::debug("User 'admin' logged in.");
}

Functions§

debug
Logs a message at the DEBUG level.
debug_with
Logs a message at the DEBUG level with additional structured metadata.
error
Logs a message at the ERROR level.
error_with
Logs a message at the ERROR level with additional structured metadata.
info
Logs a message at the INFO level.
info_with
Logs a message at the INFO level with additional structured metadata.
log
Logs a message at the INFO level. This is an alias for info().
warn
Logs a message at the WARN level.
warn_with
Logs a message at the WARN level with additional structured metadata.