3 stable releases

1.0.3 Jul 21, 2021

#540 in Debugging

Download history 13/week @ 2024-11-27 97/week @ 2024-12-04 68/week @ 2024-12-11 17/week @ 2024-12-18 3/week @ 2024-12-25 29/week @ 2025-01-01 10/week @ 2025-01-08 76/week @ 2025-02-12 3/week @ 2025-02-26

79 downloads per month
Used in 2 crates

MIT/Apache

735KB
207 lines

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

Dependencies

~1–4MB
~80K SLoC