This commit adds the ErrorRef wrapper type. It enables to log error by reference, without moving ownership. It means that it is the non-owning counterpart of ErrorValue.
Logging error references is an important use case for transparent logging middlewares. With this wrapper type, you can log the error and still pass it up the call stack.
Such a wrapper type could already easily be implemented in user applications, but having it as part of Slog should help ergonomics. This also enables further improvements by integrating it with the Slog macros.
This commit adds the
ErrorRef
wrapper type. It enables to log error by reference, without moving ownership. It means that it is the non-owning counterpart ofErrorValue
.Logging error references is an important use case for transparent logging middlewares. With this wrapper type, you can log the error and still pass it up the call stack.
Such a wrapper type could already easily be implemented in user applications, but having it as part of Slog should help ergonomics. This also enables further improvements by integrating it with the Slog macros.
Closes slog-rs/slog#288
Make sure to: