Commit 8d47821
authored
Rollup merge of #136392 - jieyouxu:wrap-tracing, r=onur-ozkan
bootstrap: add wrapper macros for `feature = "tracing"`-gated `tracing` macros
Follow-up to rust-lang/rust#136091 (comment).
- Add wrapper macros for `error!`, `warn!`, `info!`, `debug!` and `trace!`, which `cfg(feature = "tracing")`-gates the underlying `tracing` macros. They expand to nothing if `"tracing"` feature is not enabled.
- This is not done for `span!` or `event!` because they can return span guards, and you can't really wrap that.
- This is also not possible for `tracing::instrument` attribute proc-macro unless you use another attribute proc-macro to wrap that.
It's not *great*, because `tracing::instrument` and `tracing::{span,event}` can't be wrapped this way.
Can test locally with:
```bash
$ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap/
```
r? ``@onur-ozkan`` (or reroll)File tree
0 file changed
+0
-0
lines changed0 file changed
+0
-0
lines changed
0 commit comments