You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Logging configuration is recursively branched: formatting, filters, and output can be applied at each
fern::Dispatch, applying to increasingly specific kinds of logging.
// Configure logger at runtime
fern::Dispatch::new()// Perform allocation-free log formatting.format(|out, message, record| {
out.finish(format_args!("[{} {} {}] {}",
humantime::format_rfc3339(std::time::SystemTime::now()),
record.level(),
record.target(),
message
))})// Add blanket level filter -.level(log::LevelFilter::Debug)// - and per-module overrides.level_for("hyper", log::LevelFilter::Info)// Output to stdout, files, and other Dispatch configurations.chain(std::io::stdout()).chain(fern::log_file("output.log")?)// Apply globally.apply()?;// and log using log crate macros!
log::info!("hello, world!");
This shows up in one situation: if you're using colored 0.1.0 and a custom global allocator.
Upgrade to fern 0.7.0 to fix.
Contributing
There's one thing I need right now, more than anything else: input on what fern does well, and what it should keep
doing well. See Project Direction.
Besides that, I'm open to PRs! I'll probably review promptly, and I'm always open to being nudged if I don't.
For small PRs, I'll mark anything I need changed in a review, and work with you on that.
For larger PRs, I reserve the right to pull in your commits as they are, then fix things I want to be different myself.
In a workplace, I'd try to never do this - but this is a hobby project for me, and I'd rather be overly particular about
fern's implementation than be reasonable.
This is a change from my previous policy.
See CONTRIBUTING for technical information on contributing.