Skip to content

Commit ec46dcc

Browse files
committed
Bump version to v2.8.0
Rewrite changelog to be clearer and combine changes from all pre-releases. This is the biggest slog release since v2.0. See the changelog for highlights.
1 parent a447574 commit ec46dcc

File tree

2 files changed

+55
-41
lines changed

2 files changed

+55
-41
lines changed

CHANGELOG.md

Lines changed: 54 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -5,62 +5,71 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

77
## [Unreleased]
8-
* **BIG**: Enables the `nested-values` feature by default.
9-
* Bump MSRV to 1.61.
8+
9+
## [2.8.0] - 2025-10-05
10+
This is the biggest slog release since 2.0. It fully preserves compatibility with prior releases.
11+
12+
### Highlights
13+
- Enables the `nested-values` feature by default.
14+
The next major release of `slog_json`, `slog_term`, etc should also enable this feature by default.
15+
- Added `Logger::flush` and `Drain::flush` methods.
16+
- Improved support for logging errors
17+
- Have `#` log specifier transparently support `&` references to error
18+
- Implement `slog::Value` for `Box<dyn std::error::Error>` and `anyhow::Error`
19+
- Define a `prelude` module for common imports
20+
- Upgraded to Rust 2018 and require Rust 1.61
21+
- Deprecate the old `slog_log!` macros in favor of `slog::log!`
22+
- Many internal improvements & bug fixes
23+
24+
### Changed
25+
* Enables the `nested-values` feature by default.
26+
* Updated to Rust 2018
27+
* NOTE: Old 2015 crates will still work because of [excellent 2015/2018 compatibility](https://blog.rust-lang.org/2018/07/27/what-is-rust-2018.html#managing-compatibility)
28+
* Bump MSRV to 1.61
29+
- This is already required for `erased-serde`, `syn`, `serde_core`, and many other important crates in the rust ecosystem.
1030
* Update `erased-serde` from v0.3 to v0.4
11-
* Deprecate old prefixed macros like `slog_log`.
12-
Rust 2018 macro paths make these unnecessary, use `slog::log!` instead.
31+
* Depend on [`serde_core`] rather than `serde` to reduce compile times.
32+
33+
### Added
34+
* Added a `Logger::flush` and `Drain::flush` methods
35+
* Since this is a new method, not all drains implement it.
36+
Calling it on an unsupported drain will give an error
37+
* Define a `prelude` module for common imports.
38+
Replace `use slog::{Serde, Logger, info, debug, trace}` with `use slog::prelude::*`
1339
* Optionally implement Drain for [`parking_lot::Mutex`].
14-
This is noticeably faster than `std::sync::Mutex` in the uncontented case, is smaller, and avoids poisoning.
40+
This is noticeably faster than `std::sync::Mutex`, is smaller, and avoids poisoning.
1541
* This feature has a separate name per version to allow supporting multiple versions of `parking_lot` at once. The current version (v0.12) has feature name `parking_lot_0_12`
16-
* Define a `prelude` module for common imports, allowing import of logging macros (`info!`, `!debug`, ...) and `slog::Logger` in one go.
17-
* Depend on [`serde_core`] rather than `serde` to reduce compile times.
42+
* Implement slog::Value for `dyn std::error::Error` and `Box<dyn std::error:Error` (along with the `Send`/`Sync` versions).
43+
* Optionally implement slog::Value for [`anyhow::Error`] (requires `anyhow` feature)
44+
* Add `ErrorRef` wrapper to enable logging error references (PR #327)
45+
* The `#` error formatter in macros was updated to automatically select `ErrorValue` or `ErrorRef` (PR #328)
46+
* Add `emit_bytes` method (PR #290)
47+
* Control formatting using `BytesKind` enum
48+
* Implement `Value` for `std::borrow::Cow`
1849

19-
[`serde_core`]: https://docs.rs/serde_core/1/serde_core/
20-
[`parking_lot::Mutex`]: https://docs.rs/parking_lot/latest/parking_lot/type.Mutex.html
50+
### Deprecated
51+
* Deprecate old prefixed macros like `slog_log`.
52+
Rust 2018 macro paths like `slog::log!` make these unnecessary.
2153

22-
### 2.8.0-rc.1 - 2025-08-06
23-
* Minimum Supported Rust Version is now [1.56](https://blog.rust-lang.org/2021/10/21/Rust-1.56.0/).
24-
This was already required if you wanted to use the `nested-values` feature.
54+
### Fixed
55+
* Fix logging of references to errors (resolved by introduction of `ErrorRef` in PR #327)
2556
* Take advantage of the fact that in 1.81 [`std::error::Error`] has been moved to `core`.
2657
On this rust version, slog now supports the error trait without requiring `std`.
2758
* Add `#[must_use]` to most public types, including `slog::Logger`, `slog::OwnedKV`, and `slog::FnValue`.
28-
* Try to give a descriptive error when the `nested-values` feature is unsupported.
29-
* Implement slog::Value for `dyn std::error::Error` and `Box<dyn std::error:Error`,
30-
along with the `Send`/`Sync` versions.
31-
* Optionally implement slog::Value for [`anyhow::Error`].
32-
Requires the `anyhow` feature to be enabled.
59+
* Give a descriptive error when the `nested-values` feature is unsupported.
3360
* Alias the `slog::Never` type to [`std::convert::Infallible`], fixing issue #209.
3461
* doc: Fix typo in slog::Value docs (issue #335)
3562
* Thank you to @larswirzenius for noticing this!
3663
* doc: Fix "lazy continuation" in `slog::Logger` doc
3764
* This mistake was caught by a new lint [`#[warn(clippy::doc_lazy_continuation)]`](https://rust-lang.github.io/rust-clippy/rust-1.81.0/index.html#/doc_lazy_continuation)
3865
* Fix some internal warnings
3966
* Example: Avoid the new [`#[warn(unexpected_cfgs)]`](https://blog.rust-lang.org/2024/05/06/check-cfg.html) lint.
40-
* The crate almost passes clippy::pedantic now.
41-
* None of these should affect user crates
67+
* The crate almost passes clippy::pedantic now, except for a few very verbose lints like `clippy::must-use-candidate`
68+
* None of these changes should affect user crates
4269
* Stop requiring the `serde_derive` crate to implement the `nested-values` feature.
70+
We depend on the new `serde_core` instead of even requiring `serde`.
4371
* The `nested-values` feature no longer requires `serde/std` (was a mistake).
44-
* nested-values: Fix CI failure caused by `#[deny(unused_extern_crates)]` lint
45-
* Switch `#[deny(rust_2018_idioms)]` to `#[warn(...)]` to avoid unnecessary build failures in the future.
46-
* I don't *think* this should affect user code.
4772
* Always support 128-bit integers, even on the `wasm32-unknown-emscripten` target.
48-
49-
[`std::convert::Infallible`]: https://doc.rust-lang.org/std/convert/enum.Infallible.html
50-
[`anyhow::Error`]: https://docs.rs/anyhow/1/anyhow/struct.Error.html
51-
52-
### 2.8.0-beta.2 - 2024-01-05
53-
54-
* Add `ErrorRef` wrapper to enable logging error references (PR #327)
55-
* The `#` error formatter in macros was updated to automatically select `ErrorValue` or `ErrorRef` (PR #328)
56-
57-
### 2.8.0-beta.1 - 2023-09-09
58-
59-
* **BIG:** Updated to Rust 2018
60-
* NOTE: Old 2015 crates will still work because of [excellent 2015/2018 compatibility](https://blog.rust-lang.org/2018/07/27/what-is-rust-2018.html#managing-compatibility)
61-
* Minimum Supported Rust Version is now [1.49.0](https://blog.rust-lang.org/2020/12/31/Rust-1.49.0.html)
62-
* Add `emit_bytes` method (PR #290)
63-
* Control formatting using `BytesKind` enum
6473
* Fix support for `feature="nothreads"`
6574
* Internal refactoring to make different feature combos much easier (PR #301)
6675
* Switch from Travis CI to Github Actions (fixes #294)
@@ -70,10 +79,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
7079
* Make exception for `nested-values` feature on MSRV (1.49),
7180
because `erased-serde` dependency requires `edition="2021"` (needs 1.56)
7281
* Fix `#` format when not used as a last argument.
73-
* Implement `Value` for `std::borrow::Cow`
74-
* Fix duplicate `AsRef<str>` implementations, fixing support for `dynamic-keys`
82+
* Fix duplicate `AsRef<str>` implementations when using `dynamic-keys` feature.
7583
* Fix incorrect 'long' name for `slog::Level::Warning` (fixes issue #282)
7684

85+
[`std::error::Error`]: https://doc.rust-lang.org/std/error/trait.Error.html
86+
[`std::convert::Infallible`]: https://doc.rust-lang.org/std/convert/enum.Infallible.html
87+
[`anyhow::Error`]: https://docs.rs/anyhow/1/anyhow/struct.Error.html
88+
[`serde_core`]: https://docs.rs/serde_core/1/serde_core/
89+
[`parking_lot::Mutex`]: https://docs.rs/parking_lot/latest/parking_lot/type.Mutex.html
90+
7791
## 2.7.0 - 2020-11-29
7892

7993
* Implement `Hash` for `Level` and `FilterLevel`

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "slog"
3-
version = "2.8.0-rc.1"
3+
version = "2.8.0"
44
authors = ["Dawid Ciężarkiewicz <[email protected]>"]
55
description = "Structured, extensible, composable logging for Rust"
66
keywords = ["log", "logging", "structured", "hierarchical"]

0 commit comments

Comments
 (0)