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: rename Filter to EnvFilter #339

Merged
merged 9 commits into from Sep 12, 2019
Merged

subscriber: rename Filter to EnvFilter #339

merged 9 commits into from Sep 12, 2019

Conversation

hawkw
Copy link
Member

@hawkw hawkw commented Sep 11, 2019

This branch renames Filter to EnvFilter and deprecates the previous
name, as suggested in #336 (review).
This should make the difference between an EnvFilter and a
LevelFilter clearer.

@hawkw hawkw requested review from Ralith, davidbarsky and a team September 11, 2019 00:28
@github-actions github-actions bot added the crate/subscriber Related to the `tracing-subscriber` crate label Sep 11, 2019
Copy link
Collaborator

@Ralith Ralith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to rename the feature too? Should be able to maintain compatibility by preserving the filter feature as a feature that implicitly enables env-filter and maybe spits out a deprecation warning too.

@hawkw
Copy link
Member Author

hawkw commented Sep 12, 2019

@Ralith thanks for the suggestions; I've renamed the feature flag as well. I couldn't figure out a good way to emit a deprecation warning for the feature flag, but would welcome any suggestions.

I'm thinking about also changing the filter::env module to be public so that it can have module-level docs for the env filtering specifically. I may change this in a follow-up PR though.

Copy link
Collaborator

@Ralith Ralith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could add a cfg_attr(feature = "filter", ...) guarded deprecation warning to EnvFilter itself for insurance.

tracing-subscriber/Cargo.toml Outdated Show resolved Hide resolved
tracing-subscriber/src/filter/mod.rs Show resolved Hide resolved
@hawkw
Copy link
Member Author

hawkw commented Sep 12, 2019

You could add a cfg_attr(feature = "filter", ...) guarded deprecation warning to EnvFilter itself for insurance.

oh, good call!

hawkw and others added 9 commits September 12, 2019 11:32
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Co-Authored-By: Benjamin Saunders <ben.e.saunders@gmail.com>
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
@hawkw hawkw merged commit fec24bf into master Sep 12, 2019
hawkw added a commit that referenced this pull request Sep 12, 2019
Fixed:

- `EnvFilter` ignoring directives with targets that are the same number
  of characters (#333)
- `EnvFilter` failing to properly apply filter directives to events
  generated from `log` records by`tracing-log` (#344)

Changed:

- Renamed `Filter` to `EnvFilter`, deprecated `Filter` (#339)
- Renamed "filter" feature flag to "env-filter", deprecated "filter" (#339)
- `FmtSubscriber` now defaults to enabling only the `INFO` level and
  above when a max level filter or `EnvFilter` is not set (#336)

Added:

- `EnvFilter::add_directive` to add new directives to filters after they
  are constructed (#334)
- `fmt::Builder::with_max_level` to set a global level filter for a
  `FmtSubscriber` without requiring the use of `EnvFilter` (#336)
- `Layer` implementation for `LevelFilter` (#336)
- `EnvFilter` now implements `fmt::Display` (#329)

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
hawkw added a commit that referenced this pull request Sep 13, 2019
Fixed:

- `EnvFilter` ignoring directives with targets that are the same number
  of characters (#333)
- `EnvFilter` failing to properly apply filter directives to events
  generated from `log` records by`tracing-log` (#344)

Changed:

- Renamed `Filter` to `EnvFilter`, deprecated `Filter` (#339)
- Renamed "filter" feature flag to "env-filter", deprecated "filter" (#339)
- `FmtSubscriber` now defaults to enabling only the `INFO` level and
  above when a max level filter or `EnvFilter` is not set (#336)
- Made `parking_lot` dependency an opt-in feature flag (#348)

Added:

- `EnvFilter::add_directive` to add new directives to filters after they
  are constructed (#334)
- `fmt::Builder::with_max_level` to set a global level filter for a
  `FmtSubscriber` without requiring the use of `EnvFilter` (#336)
- `Layer` implementation for `LevelFilter` (#336)
- `EnvFilter` now implements `fmt::Display` (#329)

Removed:

- Removed dependency on `crossbeam-util` (#348)

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
hawkw added a commit that referenced this pull request Sep 13, 2019
### Fixed

- `EnvFilter` ignoring directives with targets that are the same number
  of characters (#333)
- `EnvFilter` failing to properly apply filter directives to events
  generated from `log` records by`tracing-log` (#344)

### Changed

- Renamed `Filter` to `EnvFilter`, deprecated `Filter` (#339)
- Renamed "filter" feature flag to "env-filter", deprecated "filter" (#339)
- `FmtSubscriber` now defaults to enabling only the `INFO` level and
  above when a max level filter or `EnvFilter` is not set (#336)

### Added:

- `EnvFilter::add_directive` to add new directives to filters after they
  are constructed (#334)
- `fmt::Builder::with_max_level` to set a global level filter for a
  `FmtSubscriber` without requiring the use of `EnvFilter` (#336)
- `Layer` implementation for `LevelFilter` (#336)
- `EnvFilter` now implements `fmt::Display` (#329)

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crate/subscriber Related to the `tracing-subscriber` crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants