Skip to content

tracing: deprecate outdated macro syntax #674

Open
@hawkw

Description

@hawkw

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.

Metadata

Metadata

Assignees

Labels

crate/tracingRelated to the `tracing` crate

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions