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

Add a method to Targets to get the default level #2242

Merged
merged 4 commits into from Jul 25, 2022
Merged

Add a method to Targets to get the default level #2242

merged 4 commits into from Jul 25, 2022

Commits on Jul 23, 2022

  1. subscriber: add a method to Targets to get the default level

    This makes it possible to fully "override" some base `Targets` filter
    with another (e.g. user-supplied) filter. Without some way to obtain the
    default, only explicit targets can be overridden (via `IntoIter` and
    friends).
    
    Ideally the method would be named `default`, corresponding to
    `with_default`, however this conflicts with `Default::default` and so
    would be a breaking change (and harm ergonomics). `default_level` seemed
    a better name than `get_default`, since "getters" of this style are
    generally considered unidiomatic[citation needed].
    connec committed Jul 23, 2022
    Copy the full SHA
    7c5bc38 View commit details
    Browse the repository at this point in the history
  2. use find_map instead of find and map

    Co-authored-by: Eliza Weisman <eliza@buoyant.io>
    connec and hawkw committed Jul 23, 2022
    Copy the full SHA
    3f127c0 View commit details
    Browse the repository at this point in the history
  3. subscriber: update Targets::default_level docs

    The new documentation includes more complete examples showing defaults
    set by `with_default` or parsed, as well as examples of no defaults and
    a specifically set `LevelFilter::OFF` default. You may also notice that
    2nd person language has been removed.
    connec committed Jul 23, 2022
    Copy the full SHA
    83e4a47 View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2022

  1. Copy the full SHA
    f630db7 View commit details
    Browse the repository at this point in the history