ghpascon-rust 0.4.0

A personal Rust utility library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Run with: cargo run --example example_logger

use ghpascon_rust::utils::logger_manager::{LogLevel, LoggerManager};

#[tokio::main]
async fn main() {
    let logger = LoggerManager::builder("example_app")
        .level(LogLevel::Debug)
        .retention_days(3)
        .build()
        .await;

    logger.debug("application starting up");
    logger.info("server listening on port 8080");
    logger.warn("memory usage above 80%");
    logger.error("failed to connect to database");
}