Skip to content

Release version 0.4.0

Compare
Choose a tag to compare
@daboross daboross released this 02 Jan 01:07
· 257 commits to main since this release
  • Rework API surface to be builder-based for simpler configuration

    • Rename DispatchConfig to Dispatch, OutputConfig to Output and FernLogger to FernLog
  • Rework inner log structure for more efficiency

    • Different outputs are now stored in an enum rather than every sublogger being a Box with dynamic dispatch
    • Remove LogError; handle errors within individual loggers now - and only within loggers which actually need it
    • Remove unnecessary wrapping of streams with an Arc (now just uses Mutex for File streams)
    • Remove unnecessary wrapping of Stdout and Stderr streams with a Mutex, when they are already synchronized
    • Pass around just &fmt::Arguments + &log::LogRecord instead of passing each individual LogRecord part
  • Move opening of files and stdout/stderr from configuration "building" to configuring

    • Instead of taking OpenOptions, log configuration now just takes an already-opened std::io::File object
    • fern::InitError is now a convenience API, and is never returned from any fern APIs
  • Redo formatting to work without allocation - formatting closures now finish with a callback rather than returning a value

  • Update examples to use chrono instead of the time crate

    • This removes another extra allocation - chrono can format time directly to a writer, without allocating intermediate the result to a String
  • Add much more documentation: almost every builder method has a full example, and all features should be thoroughly explained

  • Add appveyor and travis-ci badges to README and Cargo.toml