pink_log

Crates.iopink_log
lib.rspink_log
version0.1.1
sourcesrc
created_at2023-11-24 19:28:57.272108
updated_at2023-11-24 19:48:53.451574
descriptionA simple lightweight logger for Rust
homepage
repository
max_upload_size
id1047469
size48,333
Sakura Kade Hansen (SakuraKade)

documentation

README

pink_log

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

Examples

Toml
pink_log = "0.1.0"
Using Builder
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")));
Using Default
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")));
Commit count: 0

cargo fmt