Crates.io | logidize |
lib.rs | logidize |
version | 0.5.2 |
source | src |
created_at | 2023-04-04 16:35:30.585101 |
updated_at | 2023-04-04 18:38:48.753022 |
description | A lightweight and performant logging utility |
homepage | |
repository | https://github.com/GereonV/logidize |
max_upload_size | |
id | 830323 |
size | 41,543 |
A lightweight and performant logging utility
use logidize::{*, loggers::{Level, single_threaded::*}, sinks::WriteSink};
fn main() {
let logger: SimpleLogger<WriteSink> = Default::default();
debug!(logger, "{}", "Hello Debug!");
info!(logger, "{}", "Hello Info!");
warning!(logger, "{}", "Hello Warning!");
error!(logger, "{}", "Hello Error!");
critical!(logger, "{}", "Hello Critical!");
log!(logger, Level::DEBUG, "{}", "Hello Dynamic!");
}
use logidize::*;
fn main() {
default_logger!().sink().unwrap()
.channel_map.set_channel_name_or_insert_channel(0, "Main-Channel");
debug!("logged to global logger's main-channel");
}
use logidize::{*, loggers::single_threaded::*, sinks::WriteSink};
fn main() {
let logger: SimpleLogger<WriteSink> = Default::default();
macro_rules! default_logger { () => { logger }; }
info!("you can change what logger the macros default to");
}