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

Logger's sinks accessor #596

Closed
odygrd opened this issue Sep 27, 2024 Discussed in #593 · 0 comments · Fixed by #597
Closed

Logger's sinks accessor #596

odygrd opened this issue Sep 27, 2024 Discussed in #593 · 0 comments · Fixed by #597
Labels
enhancement New feature or request

Comments

@odygrd
Copy link
Owner

odygrd commented Sep 27, 2024

Discussed in #593

Originally posted by jol September 27, 2024
Hi,

I would like to know if it will be possible to add a kind of:

auto& LoggerBase::get_sinks()
{
    return sinks;
}

In the previous version of quill, If I remember correctly, we were able to create a root logger with multiple handlers, then when another logger was created, it "inherits" the handlers from the root logger.

I would like to be able to do something equivalent, like:

auto root_logger  = quill::Frontend::create_or_get_logger("root", {sink1, sink2});
...

// then maybe in another class / thread ... 
auto my_logger = quill::Frontend::create_or_get_logger("root", quill::Frontend::get_logger("root")->get_sinks());

What do you think about this point, maybe there is a better way to achieve this.

Regards,

Jol

@odygrd odygrd added the enhancement New feature or request label Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant