-
Notifications
You must be signed in to change notification settings - Fork 674
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
Publicly expose the code turning a dict filter to a filter function? #1123
Comments
Hi @afeblot. To be honest, I prefer not to expose such a function publicly. I think that for more advanced use cases like yours, it's advisable to implement a custom function that fits the needs exactly. The "dict filter" isn't vert complicated and is implemented here: Lines 12 to 24 in 2ba868c
You could import it instead of patching the handler filter, but I'd say it's best to just copy/paste what is required and re-use it in your own function with the pre-checks you need. |
Hi @Delgan, Lines 879 to 915 in 2ba868c
|
Sorry @afeblot but I don't really plan to expose such function publicly. |
Ok, I understand. I'll manage it on my own. |
I used to have a handler with a dict filter:
For some reason, I've had to turn this filter into a function to perform some pre-checks which would maybe drop some records, before dealing with the dict part.
But I found no way to easily transform my dict into a function I could call. That part of the code is embedded in your
Logger.add()
function.I had to monkey patch the filter to get it done, which is brittle and ugly:
I would have been happy to do something like this instead:
Or would you currently see a cleaner way to achieve this?
The text was updated successfully, but these errors were encountered: