Crates.io | pink_log |
lib.rs | pink_log |
version | 0.1.1 |
source | src |
created_at | 2023-11-24 19:28:57.272108 |
updated_at | 2023-11-24 19:48:53.451574 |
description | A simple lightweight logger for Rust |
homepage | |
repository | |
max_upload_size | |
id | 1047469 |
size | 48,333 |
A simple lightweight logger written in Rust (WIP)
WARNING: This is an early version and is not ready for beta let alone production.
Crate: https://crates.io/crates/pink_log
pink_log = "0.1.0"
use pink_log::{PinkLogger, LogSettings, LogLevel, LogSettingsBuilder, Logger};
let mut settings = LogSettingsBuilder::new(LogLevel::Trace);
settings.set_write_log_to_file(false);
let settings = settings.build();
let log = PinkLogger::new(settings);
log.trace(None);
log.trace(Some("This is a trace point"));
log.debug("This is debug message");
log.info("This is info");
log.warn("This is a warning");
log.error(Box::new(std::error::Error::new("This is an error")));
log.fatal(Box::new(std::error::Error::new("This is an fatal error")));
use pink_log::{Logger, PinkLogger};
let logger = PinkLogger::default();
logger.trace(None);
logger.trace(Some("This is a trace point"));
logger.debug("This is debug message");
logger.info("This is info");
logger.warn("This is a warning");
logger.error(Box::new(std::error::Error::new("This is an error")));
logger.fatal(Box::new(std::error::Error::new("This is an fatal error")));