Releases: SpriteOvO/spdlog-rs
Releases · SpriteOvO/spdlog-rs
v0.4.0
Highlights / New Features
- Performance is improved by 15% (see Benchmarks), and the performance of
PatternFormatter
has been significantly improved. - Most of the documentation and examples have been rewritten, they should now be more friendly to people new to this crate.
- Support constructing
PatternFormatter
from a runtime string via the new macroruntime_pattern!
. (PR #45) - New formatter
JsonFormatter
serializes log into a single line of JSON object. (PR #69, thank @NotEvenANeko) - New sink
DedupSink
for skipping consecutive repeated logs. RotatingFileSink
now has a new rotation policyPeriod
rotates after a given period. (PR #74, thank @lioriz)- New methods
on_thread_spawn
andon_thread_finish
forThreadPoolBuilder
allows to set callbacks for thread spawn and finish. (PR #54, thank @fpervaiz) - New method
Record{,Owned}::tid
to get the thread ID when the log was generated.
Improvements / Bug Fixes
- MSRV (minimum supported Rust version) is bumped to v1.60.
- Fixed
AsyncPoolSink
may lose the last logs and may panic. (PR #66) - Fallback logger name to the target from
log
crate if present. (PR #50, thank @Lancern) - Respect local timezone when rotating files by time point.
- Several internal performance optimizations.
Breaking Changes
Formatter::clone_box
is removed, now it requires all formatters to implementClone
. The inheritedDynClone
trait enables it to be cloned object-safely.FmtExtraInfo{,Builder}
has been replaced withFormatterContext
, andFormatter::format
now has a&mut FormatterContext
argument instead of returningResult<FmtExtraInfo>
.- All re-exported
log
items has been moved from modulelog_crate
tore_export::log
. - Method
LevelFilter::compare
is renamed toLevelFilter::test
. The old method is still available, but has been marked as#[deprecated]
and may be removed in a future release. - Box the
RecordOwned
in structSendToChannelErrorDropped
to avoid moving large structures on the stack. - Implementors of
Sink::log
are no longer required to callshould_log
to filter logs. Now spdlog-rs will always check first by callingshould_log
, and only calllog
when it returnstrue
. PatternContext
now has 2 new lifetimes.
v0.3.13
v0.3.12
v0.3.11
v0.3.10
v0.3.9
Changes
- Fix
{tid}
incorrectly outputting TID of thread pool inAsyncPoolSink
. (issue #28, PR #29) - Bump dependency
spin
to v0.9.8 for RUSTSEC-2023-0031. (thanks @Dylan-DPC, #27) - Bump dependency
log
to v0.4.8 as earlier versions cannot be compiled.