This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lorb
Recipients lorb, raybb, vinay.sajip
Date 2020-10-21.14:41:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1603291317.04.0.953086621009.issue41906@roundup.psfhosted.org>
In-reply-to
Content
I looked into implementing this and it's not entirely clear how it could work. The main issue I encountered is how to distinguish between a callable that is a factory that takes one argument and a callable that is a filter.

One possible approach I see is to rely on the absence of any other keys in the configuration sub-directory. Not entirely happy with that (and have to think how to treat factory with optional parameter vs filter with optional parameter).
So this would be assumed to be a filter, if inspection reveals that fltr takes an argument:
    'myfilter': {
        '()': fltr,
    }
while this would be assumed to be a factory:
    'myfilter': {
        '()': fctry,
        'bar': 'baz',
    }

A different approach that I think would be not optimal is to just call the callable with a dummy LogRecord passed ind and see if it returns a boolean or callable (or throws).
History
Date User Action Args
2020-10-21 14:41:57lorbsetrecipients: + lorb, vinay.sajip, raybb
2020-10-21 14:41:57lorbsetmessageid: <1603291317.04.0.953086621009.issue41906@roundup.psfhosted.org>
2020-10-21 14:41:57lorblinkissue41906 messages
2020-10-21 14:41:56lorbcreate