You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A "structured error" is an error which implements error and slog.LogValuer.
When encountering such an error, it gets logged normally and then another field
gets added with the result of LogValue().
The name of the extra field is the original field name plus a configurable
suffix, with "Details" as default.
The extra details are logged as if they had been passed as a value to
zapr. slog.Value.Resolve is used to protect against errors and recursion while
calling LogValue, but does not protect against recursion that can occur when
LogValue returns the original error: then zapIt->zapError->zapIt->... repeats
until the program gets killed.
A simple guard against this (not expanding error again while formatting an
error) is too simplistic and would prevent nice rendering of a wrapped error
that might get returned by MarshalLog. zapIt would have to track the exact
error instance and detect when it gets the same value again.
0 commit comments