Crates.io | lumus-log |
lib.rs | lumus-log |
version | 0.1.1 |
source | src |
created_at | 2024-04-17 20:29:59.62843 |
updated_at | 2024-04-19 17:58:55.296268 |
description | Easily console and file logger |
homepage | |
repository | |
max_upload_size | |
id | 1211739 |
size | 28,329 |
The project is a logger that enables you to set up either a file logger or a console logger in your Rust projects with custom output formats.
Here's an example of how the code can be used to build a ConsoleLogger:
use lumus_logger::ConsoleLogger;
fn main() {
let logger = ConsoleLogger::new("[ %dt - %i ] - %m");
logger.warn("Warn message");
logger.info("Info message");
logger.log("Log message");
logger.debug("Debug message");
logger.error("Error message");
}
Key | Value |
---|---|
%m | Message |
%dt | Datetime |
%d | Date |
%i | Log Type |
For .warn
example above the values for keys are:
Key | Value |
---|---|
%m | Warn message |
%dt | Y-m-d H:m:s |
%d | Y-m-d |
%i | Warn |