bootstrap: add wrapper macros for feature = "tracing"
-gated tracing
macros by jieyouxu · Pull Request #136392 · rust-lang/rust (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation6 Commits1 Checks6 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
Follow-up to #136091 (comment).
- Add wrapper macros for
error!
,warn!
,info!
,debug!
andtrace!
, whichcfg(feature = "tracing")
-gates the underlyingtracing
macros. They expand to nothing if"tracing"
feature is not enabled. - This is not done for
span!
orevent!
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:
$ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap/
r? @onur-ozkan (or reroll)
rustbot added S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
labels
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
📌 Commit acb3bab has been approved by onur-ozkan
It is now in the queue for this repository.
bors added S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request
bootstrap: add wrapper macros for feature = "tracing"
-gated tracing
macros
Follow-up to rust-lang#136091 (comment).
- Add wrapper macros for
error!
,warn!
,info!
,debug!
andtrace!
, whichcfg(feature = "tracing")
-gates the underlyingtracing
macros. They expand to nothing if"tracing"
feature is not enabled. - This is not done for
span!
orevent!
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:
$ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap/
r? @onur-ozkan
(or reroll)
bors added a commit to rust-lang-ci/rust that referenced this pull request
…iaskrgr
Rollup of 8 pull requests
Successful merges:
- rust-lang#134777 (Enable more tests on Windows)
- rust-lang#134807 (fix(rustdoc): always use a channel when linking to doc.rust-lang.org)
- rust-lang#135621 (Move some std tests to integration tests)
- rust-lang#135695 (Support raw-dylib link kind on ELF)
- rust-lang#135836 (bootstrap: only build
crt{begin,end}.o
when compiling to MUSL) - rust-lang#136235 (Pretty print pattern type values with transmute if they don't satisfy their pattern)
- rust-lang#136392 (bootstrap: add wrapper macros for
feature = "tracing"
-gatedtracing
macros) - rust-lang#136462 (mir_build: Simplify
lower_pattern_range_endpoint
)
r? @ghost
@rustbot
modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request
bootstrap: add wrapper macros for feature = "tracing"
-gated tracing
macros
Follow-up to rust-lang#136091 (comment).
- Add wrapper macros for
error!
,warn!
,info!
,debug!
andtrace!
, whichcfg(feature = "tracing")
-gates the underlyingtracing
macros. They expand to nothing if"tracing"
feature is not enabled. - This is not done for
span!
orevent!
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:
$ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap/
r? @onur-ozkan
(or reroll)
bors added a commit to rust-lang-ci/rust that referenced this pull request
…iaskrgr
Rollup of 7 pull requests
Successful merges:
- rust-lang#134777 (Enable more tests on Windows)
- rust-lang#134807 (fix(rustdoc): always use a channel when linking to doc.rust-lang.org)
- rust-lang#135621 (Move some std tests to integration tests)
- rust-lang#135836 (bootstrap: only build
crt{begin,end}.o
when compiling to MUSL) - rust-lang#136235 (Pretty print pattern type values with transmute if they don't satisfy their pattern)
- rust-lang#136392 (bootstrap: add wrapper macros for
feature = "tracing"
-gatedtracing
macros) - rust-lang#136462 (mir_build: Simplify
lower_pattern_range_endpoint
)
r? @ghost
@rustbot
modify labels: rollup
jieyouxu added a commit to jieyouxu/rust that referenced this pull request
bootstrap: add wrapper macros for feature = "tracing"
-gated tracing
macros
Follow-up to rust-lang#136091 (comment).
- Add wrapper macros for
error!
,warn!
,info!
,debug!
andtrace!
, whichcfg(feature = "tracing")
-gates the underlyingtracing
macros. They expand to nothing if"tracing"
feature is not enabled. - This is not done for
span!
orevent!
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:
$ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap/
r? @onur-ozkan
(or reroll)
bors added a commit to rust-lang-ci/rust that referenced this pull request
Rollup of 8 pull requests
Successful merges:
- rust-lang#134807 (fix(rustdoc): always use a channel when linking to doc.rust-lang.org)
- rust-lang#134814 (Add
kl
andwidekl
target features, and the feature gate) - rust-lang#135836 (bootstrap: only build
crt{begin,end}.o
when compiling to MUSL) - rust-lang#136022 (Port ui/simd tests to use the intrinsic macro)
- rust-lang#136235 (Pretty print pattern type values with transmute if they don't satisfy their pattern)
- rust-lang#136309 (set rustc dylib on manually constructed rustc command)
- rust-lang#136392 (bootstrap: add wrapper macros for
feature = "tracing"
-gatedtracing
macros) - rust-lang#136462 (mir_build: Simplify
lower_pattern_range_endpoint
)
r? @ghost
@rustbot
modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request
bootstrap: add wrapper macros for feature = "tracing"
-gated tracing
macros
Follow-up to rust-lang#136091 (comment).
- Add wrapper macros for
error!
,warn!
,info!
,debug!
andtrace!
, whichcfg(feature = "tracing")
-gates the underlyingtracing
macros. They expand to nothing if"tracing"
feature is not enabled. - This is not done for
span!
orevent!
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:
$ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap/
r? @onur-ozkan
(or reroll)
bors added a commit to rust-lang-ci/rust that referenced this pull request
…iaskrgr
Rollup of 7 pull requests
Successful merges:
- rust-lang#134807 (fix(rustdoc): always use a channel when linking to doc.rust-lang.org)
- rust-lang#134814 (Add
kl
andwidekl
target features, and the feature gate) - rust-lang#135836 (bootstrap: only build
crt{begin,end}.o
when compiling to MUSL) - rust-lang#136022 (Port ui/simd tests to use the intrinsic macro)
- rust-lang#136309 (set rustc dylib on manually constructed rustc command)
- rust-lang#136392 (bootstrap: add wrapper macros for
feature = "tracing"
-gatedtracing
macros) - rust-lang#136462 (mir_build: Simplify
lower_pattern_range_endpoint
)
r? @ghost
@rustbot
modify labels: rollup
bors added S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
and removed S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
labels
- Add wrapper macros for
error!
,warn!
,info!
,debug!
andtrace!
, whichcfg(feature = "tracing")
-gates the underlyingtracing
macros. - This is not done for
span!
orevent!
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.
Removed the cfg-gated intra-doc link. ./x doc src/bootstrap
passes locally.
@bors r=onur-ozkan rollup
📌 Commit 53b8de1 has been approved by onur-ozkan
It is now in the queue for this repository.
bors removed the S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
label
bors added the S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
label
jhpratt added a commit to jhpratt/rust that referenced this pull request
bootstrap: add wrapper macros for feature = "tracing"
-gated tracing
macros
Follow-up to rust-lang#136091 (comment).
- Add wrapper macros for
error!
,warn!
,info!
,debug!
andtrace!
, whichcfg(feature = "tracing")
-gates the underlyingtracing
macros. They expand to nothing if"tracing"
feature is not enabled. - This is not done for
span!
orevent!
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:
$ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap/
r? @onur-ozkan
(or reroll)
bors added a commit to rust-lang-ci/rust that referenced this pull request
Rollup of 9 pull requests
Successful merges:
- rust-lang#128045 (#[contracts::requires(...)] + #[contracts::ensures(...)])
- rust-lang#136263 (rustdoc: clean up a bunch of ts-expected-error declarations in main)
- rust-lang#136375 (cg_llvm: Replace some DIBuilder wrappers with LLVM-C API bindings (part 1))
- rust-lang#136392 (bootstrap: add wrapper macros for
feature = "tracing"
-gatedtracing
macros) - rust-lang#136405 (rustdoc-book: Clean up section on
--output-format
) - rust-lang#136497 (Report generic mismatches when calling bodyless trait functions)
- rust-lang#136502 (Mark
std::fmt::from_fn
as#[must_use]
) - rust-lang#136509 (Add tests for nested macro_rules edition behavior)
- rust-lang#136526 (mir_build: Rename
thir::cx::Cx
toThirBuildCx
and removeUserAnnotatedTyHelpers
)
r? @ghost
@rustbot
modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request
Rollup of 8 pull requests
Successful merges:
- rust-lang#128045 (#[contracts::requires(...)] + #[contracts::ensures(...)])
- rust-lang#136263 (rustdoc: clean up a bunch of ts-expected-error declarations in main)
- rust-lang#136375 (cg_llvm: Replace some DIBuilder wrappers with LLVM-C API bindings (part 1))
- rust-lang#136392 (bootstrap: add wrapper macros for
feature = "tracing"
-gatedtracing
macros) - rust-lang#136396 (rustdoc-json-types: Document that crate name isn't package name.)
- rust-lang#136405 (rustdoc-book: Clean up section on
--output-format
) - rust-lang#136502 (Mark
std::fmt::from_fn
as#[must_use]
) - rust-lang#136509 (Add tests for nested macro_rules edition behavior)
r? @ghost
@rustbot
modify labels: rollup
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
Rollup merge of rust-lang#136392 - jieyouxu:wrap-tracing, r=onur-ozkan
bootstrap: add wrapper macros for feature = "tracing"
-gated tracing
macros
Follow-up to rust-lang#136091 (comment).
- Add wrapper macros for
error!
,warn!
,info!
,debug!
andtrace!
, whichcfg(feature = "tracing")
-gates the underlyingtracing
macros. They expand to nothing if"tracing"
feature is not enabled. - This is not done for
span!
orevent!
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:
$ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap/
r? @onur-ozkan
(or reroll)
Labels
Area: bootstrap tracing
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)