minifemme

Crates.iominifemme
lib.rsminifemme
version1.0.3
sourcesrc
created_at2021-07-21 12:11:34.115617
updated_at2021-07-21 12:18:25.269368
descriptionRust log-compatible pretty/ndjson logger, based on femme
homepage
repositoryhttps://git.sr.ht/~ana/minifemme
max_upload_size
id425489
size788,902
liv (shadows-withal)

documentation

https://docs.rs/minifemme

README

minifemme

crates.io version docs.rs docs

Rust log-compatible pretty/ndjson logger, based on femme.

A pretty-printer and ndjson logger for the log crate.

Examples

minifemme::start(minifemme::LevelFilter::Trace, minifemme::LogMode::Pretty);
log::warn!("Unauthorized access attempt on /login");
log::info!("Listening on port 8080");

The main reason behind this crate's existence is that I needed something that works almost like femme, but with the ability to arbitrarily select the log mode.

When using Wasm with #[cfg(target_arch = "wasm32")], the Wasm logger will be used. The Wasm logger uses web_sys crate to send console.log() to JavaScript.

Screenshots

Pretty Output

pretty printed logs

Newline Delimited JSON

ndjson

Installation

$ cargo add minifemme

License

MIT OR Apache-2.0

Commit count: 0

cargo fmt