hankbao / fern

Simple, efficient logging for Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


Linux Build Status Windows Build Status Coverage Status

crates.io version badge

Simple, efficient logging for Rust.

Logging configuration is recursively branched, like a fern: formatting, filters, and output can be applied recursively to match increasingly specific kinds of logging. Fern provides a builder-based configuration backing for rust's standard log crate.

//! With fern, we can:

// Configure logger at runtime
    // Perform allocation-free log formatting
    .format(|out, message, record| {
            "{}[{}][{}] {}",
    // Add blanket level filter -
    // - and per-module overrides
    .level_for("hyper", log::LevelFilter::Info)
    // Output to stdout, files, and other Dispatch configurations
    // Apply globally

// and log using log crate macros!
info!("hello, world!");

Examples of all features at the api docs. See fern in use with this example command line program.

Project Status

The fern project is primarily maintained by myself, @daboross on GitHub. It's a hobby project, but one I aim to keep at a high quality.


As this is a hobby project, contributions are very welcome!

The easiest way for you to contribute right now is to use fern in your application, and see where it's lacking. The current library has a solid base, but it lacks features, and I may not anticipate your use cases.

If you have a use case fern does not cover, please file an issue. This is immensely useful to me, to anyone wanting to contribute to the project, and to you as well if the feature is implemented.

If you're interested in helping fix an existing issue, or an issue you just filed, help is appreciated.

See CONTRIBUTING for technical information on contributing.

ezoic increase your site revenue


Simple, efficient logging for Rust

License:MIT License


Language:Rust 100.0%