-
Notifications
You must be signed in to change notification settings - Fork 721
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
subscriber: impl fmt::Display
for filter::Targets
#2343
Merged
Merged
Conversation
This file contains 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
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. This branch adds a `fmt::Display` impl.
davidbarsky
approved these changes
Oct 9, 2022
davidbarsky
approved these changes
Oct 9, 2022
hawkw
added a commit
that referenced
this pull request
Apr 21, 2023
## 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.
hawkw
added a commit
that referenced
this pull request
Apr 21, 2023
## 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.
hawkw
added a commit
that referenced
this pull request
Apr 22, 2023
# 0.3.17 (April 21, 2023) This release of `tracing-subscriber` fixes a build error when using `env-filter` with recent versions of the `regex` crate. It also introduces several minor API improvements. ### Fixed - **env-filter**: Add "unicode-case" and "unicode-perl" to the `regex` dependency, fixing a build error with recent versions of `regex` (#2566) - A number of minor documentation typos and other fixes (#2384, #2378, #2368, #2548) ### Added - **filter**: Add `fmt::Display` impl for `filter::Targets` (#2343) - **fmt**: Made `with_ansi(false)` no longer require the "ansi" feature, so that ANSI formatting escapes can be disabled without requiring ANSI-specific dependencies (#2532) ### Changed - **fmt**: Dim targets in the `Compact` formatter, matching the default formatter (#2409) Thanks to @keepsimple1, @andrewhalle, @LeoniePhiline, @LukeMathWalker, @howardjohn, @daxpedda, and @dbidwell94 for contributing to this release!
hongquan
added a commit
to hongquan/tracing
that referenced
this pull request
Oct 10, 2023
This release of `tracing-subscriber` fixes a build error when using `env-filter` with recent versions of the `regex` crate. It also introduces several minor API improvements. - **env-filter**: Add "unicode-case" and "unicode-perl" to the `regex` dependency, fixing a build error with recent versions of `regex` (tokio-rs#2566) - A number of minor documentation typos and other fixes (tokio-rs#2384, tokio-rs#2378, tokio-rs#2368, tokio-rs#2548) - **filter**: Add `fmt::Display` impl for `filter::Targets` (tokio-rs#2343) - **fmt**: Made `with_ansi(false)` no longer require the "ansi" feature, so that ANSI formatting escapes can be disabled without requiring ANSI-specific dependencies (tokio-rs#2532) - **fmt**: Dim targets in the `Compact` formatter, matching the default formatter (tokio-rs#2409) Thanks to @keepsimple1, @andrewhalle, @LeoniePhiline, @LukeMathWalker, @howardjohn, @daxpedda, and @dbidwell94 for contributing to this release!
kaffarell
pushed a commit
to kaffarell/tracing
that referenced
this pull request
May 22, 2024
# 0.3.17 (April 21, 2023) This release of `tracing-subscriber` fixes a build error when using `env-filter` with recent versions of the `regex` crate. It also introduces several minor API improvements. ### Fixed - **env-filter**: Add "unicode-case" and "unicode-perl" to the `regex` dependency, fixing a build error with recent versions of `regex` (tokio-rs#2566) - A number of minor documentation typos and other fixes (tokio-rs#2384, tokio-rs#2378, tokio-rs#2368, tokio-rs#2548) ### Added - **filter**: Add `fmt::Display` impl for `filter::Targets` (tokio-rs#2343) - **fmt**: Made `with_ansi(false)` no longer require the "ansi" feature, so that ANSI formatting escapes can be disabled without requiring ANSI-specific dependencies (tokio-rs#2532) ### Changed - **fmt**: Dim targets in the `Compact` formatter, matching the default formatter (tokio-rs#2409) Thanks to @keepsimple1, @andrewhalle, @LeoniePhiline, @LukeMathWalker, @howardjohn, @daxpedda, and @dbidwell94 for contributing to this release!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
There's currently a
fmt::Display
impl forEnvFilter
that emits anequiovalent filter string that can be parsed back into an
EnvFilter
,but the
Targets
filter does not have afmt::Display
impl. We oughtto have one, especially to make using
Targets
withclap
v4.0 easier.Solution
This branch adds a
fmt::Display
impl forfilter::Targets
. Theimplementation is pretty straightforward.
I also added tests that a
Targets
'fmt::Display
output can be parsedback into a filter that's equivalent to the original.