[go: up one dir, main page]

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

Update Tracing component's filter after loading a config file #843

Open
aawsome opened this issue May 8, 2023 · 0 comments
Open

Update Tracing component's filter after loading a config file #843

aawsome opened this issue May 8, 2023 · 0 comments

Comments

@aawsome
Copy link
aawsome commented May 8, 2023

I want to define log levels in in a config file. To do so, I was able to get the tracing component by its ID, cast it and use the reload_filter method. This feels however awkward.

I propose to impl Component's after_config() for trace::component::Tracing.
(This is related to #332 as Component is currently derived.)

Moreover, I propose to add a method update_tracing_config(&self) -> Option<trace::Config> to Config (with default impl returning None), such that the after_config() for the Tracing component could look like:

    fn after_config(&mut self, config: &A::Cfg) -> Result<(), FrameworkError> {
        if let Some(config) = config.update_tracing(){
            self.reload_filter(config.filter)
        }
        Ok(())
    }
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

No branches or pull requests

1 participant