Crates.io | prima_rs_logger |
lib.rs | prima_rs_logger |
version | 0.1.1-rc.0 |
source | src |
created_at | 2020-12-22 10:07:08.958439 |
updated_at | 2023-12-18 14:50:36.52607 |
description | Prima logging standard library |
homepage | |
repository | https://github.com/primait/prima_rs_logger |
max_upload_size | |
id | 325882 |
size | 19,904 |
Just include prima_rs_logger = "^0.1"
in your Cargo.toml
There are two different type of guards:
use prima_rs_logger::{info, GuardLoggerCell};
// Singleton logger. Used to free user from manually passing Logger objects around.
static LOGGER_GUARD: GuardLoggerCell = GuardLoggerCell::new();
fn main() {
let app_name: &str = "myapp";
let guard = prima_rs_logger::term_guard(app_name);
LOGGER_GUARD.set(guard).expect("Cannot set global logger guard");
info!("Starting {}", app_name; "meta" => "data");
}