Skip to content
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 2 commits into from
Oct 10, 2022
Merged

Conversation

hawkw
Copy link
Member

@hawkw hawkw commented Oct 9, 2022

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.

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.
@hawkw hawkw requested review from davidbarsky and a team as code owners October 9, 2022 17:17
@hawkw hawkw enabled auto-merge (squash) October 9, 2022 17:17
@hawkw hawkw merged commit 330dacf into master Oct 10, 2022
@hawkw hawkw deleted the eliza/targets-display branch October 10, 2022 19:10
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants