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

Backport #990 (subscriber: warn if trying to enable a statically disabled level) #1021

Merged
merged 2 commits into from
Oct 7, 2020

Commits on Oct 7, 2020

  1. subscriber: warn if trying to enable a statically disabled level (tok…

    …io-rs#990)
    
    
    ## Motivation
    
    
    Fixes tokio-rs#975.
    
    ## Solution
    
    This implements the warning in `tracing-subscriber` only, as mentioned
    in
    tokio-rs#975 (comment).
    It warns whenever directives are parsed, including programmatically and
    through environment variables. It does not include the suggested new API
    which returns the filters that wouldn't be parsed.
    
    - List filters that would be ignored
    - Mention 'static max level'
    - Describe how to enable the logging
    
    Example output:
    
    ```
    $ RUST_LOG=off,debug,silenced[x]=trace cargo run -q
    warning: some trace filter directives would enable traces that are disabled statically
     | `debug` would enable the DEBUG level for all targets
     | `silenced[x]=trace` would enable the TRACE level for the `silenced` target
     = note: the static max level is info
     = note: to enable DEBUG logging, remove the `max_level_info` feature
    ```
    ![image](https://user-images.githubusercontent.com/23638587/95243324-77dc6a00-07de-11eb-8ed3-6ee2109940d4.png)
    jyn514 committed Oct 7, 2020
    Configuration menu
    Copy the full SHA
    cd9aaf1 View commit details
    Browse the repository at this point in the history
  2. Fix incorrect version number

    jyn514 committed Oct 7, 2020
    Configuration menu
    Copy the full SHA
    42e8966 View commit details
    Browse the repository at this point in the history