• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

examples/H03-May-2022-388263

src/H03-May-2022-3,3511,631

tests/H03-May-2022-588443

.cargo-checksum.jsonH A D03-May-202289 11

.cargo_vcs_info.jsonH A D09-Mar-202074 65

CHANGELOG.mdH A D09-Mar-202013.9 KiB410321

CONTRIBUTING.mdH A D18-Jun-20183.5 KiB6439

Cargo.lockH A D09-Mar-20209.7 KiB391347

Cargo.tomlH A D09-Mar-20202.5 KiB11190

Cargo.toml.orig-cargoH A D09-Mar-20201.9 KiB7760

LICENSEH A D07-May-20171 KiB84

README.mdH A D29-Jan-20203.2 KiB8161

README.md

1fern
2====
3[![Linux Build Status][travis-image]][travis-builds]
4[![Windows Build Status][appveyor-image]][appveyor-builds]
5[![Coverage Status][coveralls-badge]][coveralls-builds]
6
7[![crates.io version badge][cratesio-badge]][fern-crate]
8
9Simple, efficient logging for [Rust].
10
11---
12
13Logging 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.
14
15```rust
16//! With fern, we can:
17
18// Configure logger at runtime
19fern::Dispatch::new()
20    // Perform allocation-free log formatting
21    .format(|out, message, record| {
22        out.finish(format_args!(
23            "{}[{}][{}] {}",
24            chrono::Local::now().format("[%Y-%m-%d][%H:%M:%S]"),
25            record.target(),
26            record.level(),
27            message
28        ))
29    })
30    // Add blanket level filter -
31    .level(log::LevelFilter::Debug)
32    // - and per-module overrides
33    .level_for("hyper", log::LevelFilter::Info)
34    // Output to stdout, files, and other Dispatch configurations
35    .chain(std::io::stdout())
36    .chain(fern::log_file("output.log")?)
37    // Apply globally
38    .apply()?;
39
40// and log using log crate macros!
41info!("hello, world!");
42```
43
44Examples of all features at the [api docs][fern-docs]. See fern in use with this [example command line program][fern-example].
45
46---
47
48- [documentation][fern-docs]
49- [crates.io page][fern-crate]
50- [example program][fern-example]
51
52### Project Status
53
54The 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.
55
56### Contributing
57
58As this is a hobby project, contributions are very welcome!
59
60The 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.
61
62If 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.
63
64If you're interested in helping fix an [existing issue](https://github.com/daboross/fern/issues), or an issue you just filed, help is appreciated.
65
66See [CONTRIBUTING](./CONTRIBUTING.md) for technical information on contributing.
67
68[Rust]: https://www.rust-lang.org/
69[travis-image]: https://travis-ci.org/daboross/fern.svg?branch=master
70[travis-builds]: https://travis-ci.org/daboross/fern
71[appveyor-image]: https://ci.appveyor.com/api/projects/status/ofdv9657k88jbpel/branch/master?svg=true
72[appveyor-image]: https://ci.appveyor.com/api/projects/status/github/daboross/fern?branch=master&svg=true
73[appveyor-builds]: https://ci.appveyor.com/project/daboross/fern
74[cratesio-badge]: http://meritbadge.herokuapp.com/fern
75[coveralls-badge]: https://coveralls.io/repos/github/daboross/fern/badge.svg
76[coveralls-builds]: https://coveralls.io/github/daboross/fern
77[fern-docs]: https://docs.rs/fern/
78[fern-crate]: https://crates.io/crates/fern
79[fern-example]: https://github.com/daboross/fern/tree/master/examples/cmd-program.rs
80[log]: https://github.com/rust-lang-nursery/log
81