Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tracing: deprecate outdated macro syntax #674

Open
hawkw opened this issue Apr 9, 2020 · 1 comment
Open

tracing: deprecate outdated macro syntax #674

hawkw opened this issue Apr 9, 2020 · 1 comment
Assignees
Labels
crate/tracing Related to the `tracing` crate
Milestone

Comments

@hawkw
Copy link
Member

hawkw commented Apr 9, 2020

Feature Request

Crates

  • tracing

Motivation

Currently, tracing's event macros support outdated syntax where fields are delimited using { }. This was added due to parsing ambiguities in the macros which we have since resolved, and it is no longer necessary when writing events with messages and fields. The macros continue to support this syntax for backwards-compatibility reasons. This adds unnecessary complexity to the macros.

Proposal

In preparation for an eventual breaking change to tracing, we should consider deprecating this syntax. We could have the macro arms that use it generate an import of a hidden deprecated type, or something, so that users get a deprecation warning. Then, when we release 0.2, we can stop supporting backwards compatibility with this syntax.

Alternatives

Alternatively, we can not do this. There are two potential ways we would "not do this".

  1. We could just not drop support for this syntax in 0.2. The macros would continue to support the curly brace syntax. This would mean we would continue having to support this complexity, but we could remove it in a hypothetical future 0.3 release or something.

  2. We could just remove this syntax as part of 0.2 without deprecating it first. This is technically semver-compliant. However, I'd prefer to do a proper deprecation cycle, since it gives users a warning that they should remove uses of this syntax, before we just remove it.

@hawkw hawkw added the crate/tracing Related to the `tracing` crate label Apr 9, 2020
@hawkw hawkw added this to the tracing 0.2 milestone Apr 9, 2020
@hawkw hawkw self-assigned this Apr 9, 2020
@mladedav
Copy link
Contributor

We might want to deprecate it because curly braces are also used for evaluating const names and so the usage may become ambiguous to the parser.

See #2837

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crate/tracing Related to the `tracing` crate
Projects
None yet
Development

No branches or pull requests

2 participants