Repository navigation
Release version 0.2.0
This version reworks the public API in order to turn fern into a backend to the log crate.
API Changes:
- Remove the
localmodule, as thelogcrate now handles storing a global logger. - fern::Logger must now be Sync + Send
- BoxedLogger and ArcLogger typedefs are removed, due to writing
+ Sync + Sendno longer being required - Now everything just uses Box
- Level is removed, in favor of using log::LogLevel and log::LogLevelFilter
- LoggerConfig is renamed into DispatchConfig
- Rename
ErrortoLogError- Implement
fmt::DisplayforLogError
- Implement
- A new
Formattertype is added for formatting closures. It also now takes a &log::LogLocation parameters as well. - OutputConfig::Parent is renamed into OutputConfig::Child, this seems to make more sense, given that you can have any number of children
- Logger::log() now takes (&str, &log::LogLevel, &log::LogLocation) instead of (&fern::Level, &str)
- Add an
IntoLogtrait which DispatchConfig and OutputConfig implement (instead of havinginto_logger()on each of them. - Add an
into_log()method to the IntoLog trait that turns a log configuration into alog::Log(as apposed tofern::Logger) - Rename
IntoLog.into_logger()toIntoLog.into_fern_logger()in order to differentiate from theinto_log()method. - Add a
fern::init_global_logger()method which sets the globallogcrate logger from a log configuration - Add an
InitErrorerror which is used byinit_global_logger()for either an IO error orlog::SetLoggerError - Update everything to use the new io and path modules
- Add a
FileOptionsoption toOutputConfigwhich allows for specifying anOpenOptionsfor opening the log file with
Also:
- The docs have been rewritten to be up to date with all the above changes
- The code snippets in the docs are now all tested! This is instead of having
no_testand not having fully workable code examples. - There is a new
tests/lib.rsfile which contains tests for initializing fern and log filtering with different log levels.