v0.3.0
Highlights
-
Performance is improved by 45% (see Benchmarks).
-
PatternFormatter
withpattern!
macro allows users to configure logging format using a literal string at compile-time. (#12, much appreciated @Lancern) -
AsyncPoolSink
can be combined with any sink to process log records asynchronously (non-blocking).
New Features
-
JournaldSink
writes log records tosystemd-journal
. (linux
targets only) -
WriteSink
writes log records to any object that implementsWrite
trait. -
All sinks have now implemented
Builder
structs, which bring the ability for users to specify optional and required parameters in an unordered, flexible manner, and check for missing required parameters at compile-time. -
New function
init_env_level_from
allows parsing env-level from a user-given string instead of the environment variableSPDLOG_RS_LEVEL
. -
New methods
LoggerBuilder::{fork_with, fork_with_name}
can configure a new separate logger from an existing logger. (#15) -
More new items:
Improvements / Bug Fixes
-
FullFormatter
now output terminal-friendly source file full path. -
Now leap seconds will be handled and displayed correctly.
-
Re-exported some items from
log
crate to a new modulelog_crate
for convenience. -
Public APIs have been marked with
#[must_use]
attribute if appropriate. -
Now if an invalid
rotation_policy
is used to constructRotatingFileSink
, an error will be returned instead of panic.
Breaking Changes
-
fn LoggerBuilder::build
now returnsResult<Logger>
instead of panic. -
struct RecordBuilder
andfn Record::new
are removed. -
WinDebugSink
is now only enabled when featurenative
is enabled -
trait Sink
added a new methodset_error_handler
and removed methodswap_formatter
. -
trait Formatter
added a new methodclone_box
. -
All error types are moved into a new module
error
. -
Deprecated methods
{LoggerBuilder, StyleBuilder, StdStreamSink, FileSink, RotatingFileSink, WinDebugSink, Style}::new
, use Builder methods instead.
Others
- Since this release, MSRV (the minimum supported Rust version) will be guaranteed and maintained. Currently it is 1.56.