Skip to content

Allow static string to be used as key in macros #484

@Thomasdezeeuw

Description

@Thomasdezeeuw

Currently it uses an indent, which doesn't allow for static strings. I would like to be able to do the following:

log::warn!(trace = log::as_display!("some trace id"); "message"); // Ok.
log::warn!("logging.googleapis.com/trace" = log::as_display!("some trace id"); "message"); // Doesn't compile.

It could be that this is very niche and complex to implement, in which case we can continue using our work around.

Related #436, /cc @KodrAus

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions