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 FilteredLog utility to combine a Filter with a Log. #295

Closed
wants to merge 2 commits into from

Conversation

de-vri-es
Copy link

This can be used by end-users that want to combine the filtering capabilities of env_logger with a different Log implementation.

In my case, I want to combine the filtering of env_logger with systemd-journal-logger. I could just do it myself where I need it, but this feels like something that could be useful to provide from env_logger already.

@epage
Copy link
Contributor

epage commented Jan 16, 2024

#193 is the issue for this. I lean towards the crate-splitting route, over publically exposing these details within this crate.

@de-vri-es
Copy link
Author

de-vri-es commented Jan 16, 2024

The Filter type is already exposed though. It's true that you could pull in less dependencies if you only want the Filter type.

So.. if I make a PR to split Filter to a separate crate (env_logger_filter, env_log_filter, env_filter, bikeshed...) and re-export it from env_logger, would that be a good way forward?

And then would you be inclined to accept this utility to wrap an existing logger?

This can be used by end-users that want to combine the filtering
capabilities of `env_logger` with a different `Log` implementation.
@de-vri-es
Copy link
Author

de-vri-es commented Jan 16, 2024

Pushed a commit to split the filter module off to a separate crate. What do you think?

Or do you think it would be better to move it to a separate git repo?

@epage
Copy link
Contributor

epage commented Jan 19, 2024

I've incorporated parts of this into #299 and #300

@epage epage closed this Jan 19, 2024
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

Successfully merging this pull request may close these issues.

2 participants