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.
slog.Attreverywhere — Useslog.String(),slog.Int(),slog.Group(), etc. directly inerrors.Wrap()anderrors.Errorf()alongside existing options.errors.Attrs(err)— Extract all attributes from an error chain for custom logging.errors.Log(ctx, logger, err)— Log an error at Error level with attributes and stack trace.errors.LogLevel(ctx, logger, level, err)— Same as above with an explicit level (Debug, Info, Warn, Error).- New attribute options —
Int64,Uint64,Float64,Any.Valueis deprecated in favor ofAny. - Grouped attributes — Full support for
slog.Groupin errors, JSON marshaling, and%+vformatting (dot notation). slog.LogValuer— Errors implementLogValuerfor native slog handling.
- Custom
Fieldtypes andFieldLoggerare removed; useslog.Attrand*slog.Logger. LoggableErrornow requiresAttrs() []slog.Attrinstead ofLogFields(FieldLogger).errors.Log(err, logger)replaced byerrors.Log(ctx, logger, err).- Package requires Go 1.21+.
- logrus adapter removed — see migration guide for a small custom adapter if needed.
If you are upgrading from v0.4.x, read the Migration Guide for step-by-step instructions and before/after examples.