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
There's no strong convention for how an Error should display itself. However, an increasing number of crates no longer include the error source in their Display implementation any more (aws-sdk for example: awslabs/aws-sdk-rust#657). So it becomes the callers' or the loggers' responsibility to visit the source chain and get them formatted.
We already done this in the DefaultVisitor and PrettyVisitor for the fmt layer. And I'm wondering whether we should also handle the sources in JsonVisitor as well.
Proposal
Override Visit::record_error in JsonVisitor, add additional field named <field>.sources with type string[] for error sources (if exist).
Alternatives
The text was updated successfully, but these errors were encountered:
Feature Request
Crates
tracing-subscriber
Motivation
There's no strong convention for how an
Error
should display itself. However, an increasing number of crates no longer include the error source in theirDisplay
implementation any more (aws-sdk
for example: awslabs/aws-sdk-rust#657). So it becomes the callers' or the loggers' responsibility to visit the source chain and get them formatted.We already done this in the
DefaultVisitor
andPrettyVisitor
for thefmt
layer. And I'm wondering whether we should also handle the sources inJsonVisitor
as well.Proposal
Override
Visit::record_error
inJsonVisitor
, add additional field named<field>.sources
with typestring[]
for error sources (if exist).Alternatives
The text was updated successfully, but these errors were encountered: