Crates.io | mutex_logger |
lib.rs | mutex_logger |
version | 1.0.0 |
source | src |
created_at | 2024-08-29 22:30:43.175001 |
updated_at | 2024-09-05 09:10:40.757188 |
description | a crate for a logger that usess mutex for thread safty |
homepage | |
repository | https://github.com/LiorBuch/MutexLogger/tree/ver1.0.0 |
max_upload_size | |
id | 1357126 |
size | 14,311 |
A Rust logging crate designed for multithreaded environments. MLogger
uses mutex guards to ensure thread-safe logging, preventing data races when logging from multiple threads concurrently.
MLogger
supports different verbosity levels to control which logs are displayed:
let logger = Logger::init(Verbosity::Warn, 100);
logger.log("this is error log!", Verbosity::Error).unwrap();
logger.log("this is info log! it will not show!", Verbosity::Info).unwrap();
println!("{}",logger.get_size().unwrap());