Skip to content

reload not working in tracing-subscriber v0.3.15 #2314

Open
@cedricje

Description

@cedricje

Bug Report

Version

└── tracing-subscriber v0.3.15
    ├── tracing v0.1.36
    │   └── tracing-core v0.1.29
    ├── tracing-core v0.1.29 (*)
    └── tracing-log v0.1.3
        └── tracing-core v0.1.29 (*)

Platform

Linux LNMX-LPT005 5.4.0-125-generic #141-Ubuntu SMP Wed Aug 10 13:42:03 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Crates

tracing-subscriber and/or tracing_log

Description

When reloading a filter i don't see the log records that were enabled by the filter.
This started with version v0.3.15 of the tracing-subscriber crate, v0.3.14 works.
The features tracing-log and env-filter are enabled on the tracing-subscriber crate

This is an example:

use tracing_subscriber::EnvFilter;
use tracing_subscriber::{fmt, prelude::*, reload};

fn main() {
    let filter = EnvFilter::from_default_env();
    let (filter, reload_handle) = reload::Layer::new(filter);

    tracing_subscriber::registry()
        .with(filter)
        .with(fmt::Layer::default())
        .init();

    reload_handle.reload("info").unwrap();
    log::error!("error trace");
    log::info!("info trace");
}

When running this with tracing-subscriber v0.3.15, error trace is shown, but not info trace. WIth eg. version v0.3.14 it shows info trace.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions