Skip to content

Consider specializing self. in macros #664

Open
@LucioFranco

Description

@LucioFranco

Currently, in the tracing macros to set a field that lives on self I need to do something like this:

let error = self.error;
error!(%error);

but ideally, I'd like to do:

error!(%self.error);

and these two should be equivalent. Currently this is not the case and we will get an output like: self.error = "...". I would like to propose that if the macros see self. we remove the self. part and just use the post fix value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    crate/tracingRelated to the `tracing` cratekind/featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions