Skip to content

Commit 428c9db

Browse files
committed
add release notes for v0.5.0
1 parent ecded82 commit 428c9db

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

RELEASE_NOTES.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Release notes
2+
3+
## v0.5.0
4+
5+
**Native `log/slog` integration.** This release replaces the custom field system with `slog.Attr` as the core type for error attributes. The logrus adapter has been removed.
6+
7+
### Highlights
8+
9+
- **`slog.Attr` everywhere** — Use `slog.String()`, `slog.Int()`, `slog.Group()`, etc. directly in `errors.Wrap()` and `errors.Errorf()` alongside existing options.
10+
- **`errors.Attrs(err)`** — Extract all attributes from an error chain for custom logging.
11+
- **`errors.Log(ctx, logger, err)`** — Log an error at Error level with attributes and stack trace.
12+
- **`errors.LogLevel(ctx, logger, level, err)`** — Same as above with an explicit level (Debug, Info, Warn, Error).
13+
- **New attribute options**`Int64`, `Uint64`, `Float64`, `Any`. `Value` is deprecated in favor of `Any`.
14+
- **Grouped attributes** — Full support for `slog.Group` in errors, JSON marshaling, and `%+v` formatting (dot notation).
15+
- **`slog.LogValuer`** — Errors implement `LogValuer` for native slog handling.
16+
17+
### Breaking changes
18+
19+
- Custom `Field` types and `FieldLogger` are removed; use `slog.Attr` and `*slog.Logger`.
20+
- `LoggableError` now requires `Attrs() []slog.Attr` instead of `LogFields(FieldLogger)`.
21+
- `errors.Log(err, logger)` replaced by `errors.Log(ctx, logger, err)`.
22+
- Package requires **Go 1.21+**.
23+
- **logrus adapter removed** — see migration guide for a small custom adapter if needed.
24+
25+
### Migration
26+
27+
**If you are upgrading from v0.4.x, read the [Migration Guide](https://github.com/muonsoft/errors/blob/main/MIGRATION.md)** for step-by-step instructions and before/after examples.

0 commit comments

Comments
 (0)