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
tracing supports recording returned value by #[instrument(ret)]. But, I think that it is useful that returned value is used in fields arguments. For example, #[instrument(fields(processed_returned = func(%ret))] like adding field based on the function argument.
Proposal
I proposed adding new reserved keyword for returned value like %ret for fields. It can be used for calculating new field from the returned value.
Alternatives
Now, it can be done by manual recoding like Span::current().record("new_field", func(&returned_value)); before returning value.
The text was updated successfully, but these errors were encountered:
Feature Request
Crates
tracing
Motivation
tracing
supports recording returned value by#[instrument(ret)]
. But, I think that it is useful that returned value is used infields
arguments. For example,#[instrument(fields(processed_returned = func(%ret))]
like adding field based on the function argument.Proposal
I proposed adding new reserved keyword for returned value like
%ret
forfields
. It can be used for calculating new field from the returned value.Alternatives
Now, it can be done by manual recoding like
Span::current().record("new_field", func(&returned_value));
before returning value.The text was updated successfully, but these errors were encountered: