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 support for querying and visiting sinks #184

Open
ropieur opened this issue May 16, 2022 · 3 comments
Open

Add support for querying and visiting sinks #184

ropieur opened this issue May 16, 2022 · 3 comments

Comments

@ropieur
Copy link

ropieur commented May 16, 2022

Hi,
I would need to allow my application to provide to the end user with a dynamic control on sinks configured in settings file (typically, change the filtering at runtime).
For that, I would need to have to list of the configured sinks, but from my searches results on the web, it looks like there is no such a support.

Would it be possible to add the support for querying and visiting the sinks?
If not, what alternative solution would you suggest (if possible, without having to reimplement setup file parser)?

Thanx in advance

@Lastique
Copy link
Member

You are right, there is currently no way to discover the registered sinks after initializing the logging library. I would like to rectify this, but it's not clear how to do this to make it a useful feature.

Sinks, formatters and filters that are registered in the core with erased types. For example, the core operates on sinks through a pointer to sink interface, which is useful for feeding log records but not much else. The core, or the setup helper function, cannot produce a pointer to the actual sink that derives from this interface, like synchronous_sink<text_file_backend> for instance. It could produce a pointer to sink, which would require the user to use whatever means to discover the actual type of the sink, which doesn't look very useful.

@ropieur
Copy link
Author

ropieur commented May 18, 2022

Hi @Lastique ,
I guess that this kind of extension will not pop up in a short term. Do you have suggestions how I could proceed meanwhile?

@Lastique
Copy link
Member

One workaround would be to register your own sink factories that will remember the sinks they create.

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

2 participants