-
Notifications
You must be signed in to change notification settings - Fork 722
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
backport a gigantic pile of stuff #2570
Commits on Apr 21, 2023
-
chore: allow renamed and removed lints on docs build (#2344)
Currently, the Netlify docs are failing because of a warning that one of the lints we explicitly enable is no longer a warning on nightly but becoming a hard error. This is because the docs are built on nightly with `-D warnings`, which denies all warnings...which seems not ideal. For now, let's not remove that lint from the `deny` list, as it's still a valid lint on stable. Instead, this PR explicitly allows that lint on the docs build.
Configuration menu - View commit details
-
Copy full SHA for 7c09e57 - Browse repository at this point
Copy the full SHA 7c09e57View commit details -
subscriber: impl
fmt::Display
forfilter::Targets
(#2343)## Motivation There's currently a `fmt::Display` impl for `EnvFilter` that emits an equiovalent filter string that can be parsed back into an `EnvFilter`, but the `Targets` filter does not have a `fmt::Display` impl. We ought to have one, especially to make using `Targets` with `clap` v4.0 easier. ## Solution This branch adds a `fmt::Display` impl for `filter::Targets`. The implementation is pretty straightforward. I also added tests that a `Targets`' `fmt::Display` output can be parsed back into a filter that's equivalent to the original.
Configuration menu - View commit details
-
Copy full SHA for 81f94fe - Browse repository at this point
Copy the full SHA 81f94feView commit details -
attributes: support custom levels for
ret
anderr
(#2335)This branch adds the ability to override the level of the events generated by the `ret` and `err` arguments to `#[instrument]`. An overridden level can be specified with: ```rust ``` ```rust ``` and so on. This syntax is fully backwards compatible with existing uses of the attribute. In addition, some refactoring was done to how levels are parsed and how the tokens for a specified level is generated. Fixes #2330 ; Conflicts: ; tracing-attributes/src/lib.rs
Configuration menu - View commit details
-
Copy full SHA for 528e633 - Browse repository at this point
Copy the full SHA 528e633View commit details -
attributes: improve docs; tests for using Levels in
#[instrument]
(#……2350) This branch adds documentation and tests noting that the `#[instrument]` macro accepts `tracing::Level` directly. Using `tracing::Level` directly allows for IDE autocomplete and earlier detection of typos. The documentation for tracing-attributes was also rewritten to remove the usage of the second-person perspective, making it more consistent with the rest of tracing's documentation. Co-authored-by: David Barsky <[email protected]> ; Conflicts: ; tracing-attributes/Cargo.toml ; tracing-attributes/src/lib.rs
Configuration menu - View commit details
-
Copy full SHA for 8cc41bf - Browse repository at this point
Copy the full SHA 8cc41bfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 17c1c64 - Browse repository at this point
Copy the full SHA 17c1c64View commit details -
subscriber: fix wrong
doc_cfg
attribute (#2368)This `doc_cfg` attribute's `cfg` part has multiple predicates without an `all`, which iis what's breaking the netlify build. I'm...kind of surprised this ever succeeded, since the cfg is malformed...
Configuration menu - View commit details
-
Copy full SHA for b7c5609 - Browse repository at this point
Copy the full SHA b7c5609View commit details -
appender: allow worker thread name to be configured (#2365)
## Motivation The worker thread name in non blocking mode is always "tracing-appender". It can be convenient to quickly identify the appender threads for audit reasons or affinity pinning. ## Solution This patch adds a new setter to the builder and propagates the info to the thread initialization. Closes #2364
Configuration menu - View commit details
-
Copy full SHA for 018ded8 - Browse repository at this point
Copy the full SHA 018ded8View commit details -
attributes: allow
clippy::unreachable
warning (#2356)## Motivation PR #2270 added an unreachable branch with an explicit return value to `#[instrument]` in `async fn`s in order to fix type inference issues. That PR added the appropriate `#[allow]` attribute for the Rust compiler's unreachable code linting, but not Clippy's, so a Clippy warning is still emitted. See: #2270 (comment) ## Solution Adding the clippy lint warning as discussed here: #2270 (comment)
Configuration menu - View commit details
-
Copy full SHA for 099f133 - Browse repository at this point
Copy the full SHA 099f133View commit details -
appender: Fix typo in RollingFileAppender docs (#2375)
The `MakeWriter` trait comes from the `tracing-subscriber` crate, not `tracing-appender`.
Configuration menu - View commit details
-
Copy full SHA for f0242bd - Browse repository at this point
Copy the full SHA f0242bdView commit details -
fix(docs): Remove accidentally duplicated words (#2378)
## Motivation There is a small wording mistake in the tracing-subscriber docs that can be fixed quickly and easily. ## Solution Two duplicate words were removed.
Configuration menu - View commit details
-
Copy full SHA for 40b576f - Browse repository at this point
Copy the full SHA 40b576fView commit details -
chore: Remove
doc(html_root_url)
attribute from all crates. (#2384)Fixes #2383. ; Conflicts: ; tracing-appender/src/lib.rs ; tracing-attributes/src/lib.rs ; tracing-core/src/lib.rs ; tracing-error/src/lib.rs ; tracing-futures/src/lib.rs ; tracing-log/src/lib.rs ; tracing-opentelemetry/src/lib.rs ; tracing-serde/src/lib.rs ; tracing-subscriber/src/lib.rs ; tracing/src/lib.rs
Configuration menu - View commit details
-
Copy full SHA for ac8ddf4 - Browse repository at this point
Copy the full SHA ac8ddf4View commit details -
subscriber: dim
Compact
targets, matching the default formatter (#2409) ## Motivation Fixes #2408 ## Solution Just switch to use `dim` Before: ![2022-12-08_13-58-40](https://user-images.githubusercontent.com/623453/206576169-63ee4e20-b56f-4c63-a9b3-80ba2e97eec9.png) After: ![2022-12-08_13-55-36](https://user-images.githubusercontent.com/623453/206576055-878d360f-7b95-4e18-bc31-4fb6f1b71a3a.png) Full mode for comparison: ![2022-12-08_13-55-48](https://user-images.githubusercontent.com/623453/206576054-6e38852c-cb3a-4b84-98e5-50463cdb5073.png)
Configuration menu - View commit details
-
Copy full SHA for 38c1d8b - Browse repository at this point
Copy the full SHA 38c1d8bView commit details -
attributes: add compile error on const fn instrumentation (#2418)
## Motivation The `#[instrument]` macro cannot be used on `const fn`s, because the generated code will perform runtime tracing behavior. However, when adding the attribute to a `const fn`, the compiler errors generated currently are somewhat unclear (see #2414). It would be better if we generated a less verbose error that simply states that `#[instrument]` is not supported on `const fn`s. ## Solution This branch changes the `#[instrument]` macro to detect when the annotated function is a `const fn`, and emit a simpler, more descritpive error message. The new error simply states that the `#[instrument]` attribute cannot be used on `const fn`s, and should be much less confusing to the user. Fixes #2414
Configuration menu - View commit details
-
Copy full SHA for 191cdc5 - Browse repository at this point
Copy the full SHA 191cdc5View commit details -
chore: fix new clippy lints from 1.67.0 (#2451)
There are new warnings as errors reported by clippy in Rust 1.67.0. This are causing builds to fail, e.g.: https://github.com/tokio-rs/tracing/actions/runs/4027112923/jobs/6922513360 In both cases they are reports of lifetimes that can be elided. This change removes the unnecessary lifetime annotations to make clippy happy.
Configuration menu - View commit details
-
Copy full SHA for 0328b5f - Browse repository at this point
Copy the full SHA 0328b5fView commit details -
attributes: document default level for
err
(#2433)## Motivation The current description for the default level of the `err` return value event _strongly implies_ it's the same as the span. However, the implementation actually defaults to `ERROR`. ## Solution This PR documents that, so future generations don't have to chase down the truth, like I did. 😉
Configuration menu - View commit details
-
Copy full SHA for 59d9ae3 - Browse repository at this point
Copy the full SHA 59d9ae3View commit details -
chore: move tracing-opentelemetry to its own repo (#2523)
This PR removes tracing-opentelemetry to a dedicated repo located at https://github.com/tokio-rs/tracing-opentelemetry. (Note that at time of writing this PR, the new repo has not be made public). We're moving tracing-opentelemetry to a dedicated repository for the following reasons: 1. opentelemetry's MSRV is higher than that of `tracing`'s. 2. more importantly, the main `tracing` repo is getting a bit unweildy and it feels unreasonable to maintain backports for crates that integrate with the larger tracing ecosystem. (https://github.com/tokio-rs/tracing-opentelemetry does not have the examples present in this repo; this will occur in a PR that will be linked from _this_ PR.)
Configuration menu - View commit details
-
Copy full SHA for c71fb14 - Browse repository at this point
Copy the full SHA c71fb14View commit details -
subscriber: dim
Compact
targets, matching the default formatter (#2409) Fixes #2408 Just switch to use `dim` Before: ![2022-12-08_13-58-40](https://user-images.githubusercontent.com/623453/206576169-63ee4e20-b56f-4c63-a9b3-80ba2e97eec9.png) After: ![2022-12-08_13-55-36](https://user-images.githubusercontent.com/623453/206576055-878d360f-7b95-4e18-bc31-4fb6f1b71a3a.png) Full mode for comparison: ![2022-12-08_13-55-48](https://user-images.githubusercontent.com/623453/206576054-6e38852c-cb3a-4b84-98e5-50463cdb5073.png) ; Conflicts: ; tracing-subscriber/src/fmt/format/mod.rs
Configuration menu - View commit details
-
Copy full SHA for 0192304 - Browse repository at this point
Copy the full SHA 0192304View commit details -
Configuration menu - View commit details
-
Copy full SHA for fd17727 - Browse repository at this point
Copy the full SHA fd17727View commit details -
tracing:
inline
methods to make macro-generated code smaller (#2555)## Motivation Make `tracing::event!` codegen smaller ## Solution Add `inline` to several functions called by `tracing::event!`. Simple example: https://github.com/ldm0/tracing_test After inlining, executable size drops from 746kb to 697kb (`cargo build --release + strip`), saves 50 bytes per `event!`. Test environment: ``` toolchain: nightly-aarch64-apple-darwin rustc-version: rustc 1.70.0-nightly (88fb1b922 2023-04-10) ``` There are also performance improvements in the benchmarks: ``` event/scoped [-40.689% -40.475% -40.228%] event/scoped_recording [-14.972% -14.685% -14.410%] event/global [-48.412% -48.217% -48.010%] span_fields/scoped [-25.317% -24.876% -24.494%] span_fields/global [-39.695% -39.488% -39.242%] span_repeated/global [-27.514% -26.633% -25.298%] static/baseline_single_threaded [-32.275% -32.032% -31.808%] static/single_threaded [-29.628% -29.376% -29.156%] static/enabled_one [-29.777% -29.544% -29.305%] static/enabled_many [-30.901% -30.504% -30.140%] dynamic/baseline_single_threaded [-20.157% -19.880% -19.603%] ``` I retried benchmark several times and the improvements seem to be fairly stable. raw log: https://gist.github.com/ldm0/6573935f4979d2645fbcf5bde7361386
Configuration menu - View commit details
-
Copy full SHA for 334bee7 - Browse repository at this point
Copy the full SHA 334bee7View commit details -
Remove dep
cfg-if
from tracing (#2553)Same reason as rust-lang/log#536 : `cfg_if` is only used in a single place and `tracing` is used by many other crates, so even removing one dependency will be beneficial. Remove dependency `cfg-if` and replace `cfg_if::cfg_if!` with a `const fn get_max_level_inner() -> LevelFilter` and uses `if cfg!(...)` inside. Using if in const function is stablised in [1.46](https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1460-2020-08-27) so this should work fine in msrv 1.56 Signed-off-by: Jiahao XU <[email protected]> ; Conflicts: ; tracing/Cargo.toml ; tracing/src/level_filters.rs
Configuration menu - View commit details
-
Copy full SHA for b5f6317 - Browse repository at this point
Copy the full SHA b5f6317View commit details -
attributes: remove unused syn's feature visit (#2530)
Remove unused `syn`s feature `visit` ; Conflicts: ; tracing-attributes/Cargo.toml
Configuration menu - View commit details
-
Copy full SHA for 6feda04 - Browse repository at this point
Copy the full SHA 6feda04View commit details -
attributes: update to syn 2.0 (#2516)
## Motivation syn 2.0 is out! ## Solution Update to syn 2.0 🚀 Co-authored-by: David Barsky <[email protected]> Co-authored-by: Eliza Weisman <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 83cc0b0 - Browse repository at this point
Copy the full SHA 83cc0b0View commit details -
subscriber: add ability to disable ANSI without crate feature (#2532)
## Motivation Currently it is not possible to disable ANSI in `fmt::Subscriber` without enabling the "ansi" crate feature. This makes it difficult for users to implement interoperable settings that are controllable with crate features without having to pull in the dependencies "ansi" does. I hit this while writing an application with multiple logging options set during compile-time and I wanted to cut down on dependencies if possible. ## Solution This changes `fmt::Subscriber::with_ansi()` to not require the "ansi" feature flag. This way, `with_ansi(false)` can be called even when the "ansi" feature is disabled. Calling `with_ansi(true)` when the "ansi" feature is not enabled will panic in debug mode, or print a warning if debug assertions are disabled. Co-authored-by: Eliza Weisman <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 192921c - Browse repository at this point
Copy the full SHA 192921cView commit details -
mock: move layer mock from tracing-subscriber tests (#2369)
The `tracing-subscriber` module `tests::support` included functionality to mock a layer (via the `Layer` trait). This code depends on some items from `tracing_mock::collector` which should otherwise not be public. This change moves the mocking functionality inside `tracing-mock` behind a feature flag. Allowing the `Expect` enum and `MockHandle::new` from `tracing_mock::collector` to be made `pub(crate)` instead of `pub`. Since it's now used from two different modules, the `Expect` enum has been moved to its own module. This requires a lot of modifications to imports so that we're not doing wildcard imports from another crate (i.e. in `tracing-subscriber` importing wildcards from `tracing-mock`). This PR is based on @hds' PR #2369, but modified to track renamings. I also deleted all the doc comments temporarily because updating them was a lot of work and I need to get a release of `tracing-subscriber` out first. Closes: #2359
Configuration menu - View commit details
-
Copy full SHA for f079c81 - Browse repository at this point
Copy the full SHA f079c81View commit details -
tracing, tracing-futures: instrument
Future
insideDrop
(#2562)## Motivation Currently it is not possible to disable ANSI in `fmt::Subscriber` without enabling the "ansi" crate feature. This makes it difficult for users to implement interoperable settings that are controllable with crate features without having to pull in the dependencies "ansi" does. I hit this while writing an application with multiple logging options set during compile-time and I wanted to cut down on dependencies if possible. ## Solution This changes `fmt::Subscriber::with_ansi()` to not require the "ansi" feature flag. This way, `with_ansi(false)` can be called even when the "ansi" feature is disabled. Calling `with_ansi(true)` when the "ansi" feature is not enabled will panic in debug mode, or print a warning if debug assertions are disabled. Co-authored-by: daxpedda <[email protected]> Co-authored-by: Eliza Weisman <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6b60a04 - Browse repository at this point
Copy the full SHA 6b60a04View commit details -
attributes: update UI tests with the latest stable version of Rust (#…
…2568) updated UI tests using TRYBUILD=overwrite with the latest stable version of Rust ## Motivation UI tests are failing on the latest stable version of Rust ## Solution Run `TRYBUILD=overwrite cargo test` to update the effected files.
Configuration menu - View commit details
-
Copy full SHA for a6326ef - Browse repository at this point
Copy the full SHA a6326efView commit details -
subscriber: add "unicode-case" and "unicode-perl" features to
regex
…… dependency (#2566) ## Motivation Missing features for the `regex` crate were causing build time errors due to the the use of unicode characters in the regex without using the proper features within the regex crate ## Solution Add the missing feature flags. Fixes #2565 Authored-by: Devin Bidwell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f1c188f - Browse repository at this point
Copy the full SHA f1c188fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2575f20 - Browse repository at this point
Copy the full SHA 2575f20View commit details