jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/971568 )
Change subject: [IMPR] Filter does not have to be subclassed ......................................................................
[IMPR] Filter does not have to be subclassed
Any instance can be passed which has a filter method with the same semantics: https://docs.python.org/3/library/logging.html?highlight=logging%20filter#lo...
This also solves an deepsource PY-A6006 issue.
Change-Id: Ic2d3c345725ed33809c484be709f0c3d8b282149 --- M pywikibot/userinterfaces/terminal_interface_base.py 1 file changed, 18 insertions(+), 3 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/userinterfaces/terminal_interface_base.py b/pywikibot/userinterfaces/terminal_interface_base.py index 9ba7545..b58e9c0 100644 --- a/pywikibot/userinterfaces/terminal_interface_base.py +++ b/pywikibot/userinterfaces/terminal_interface_base.py @@ -608,12 +608,12 @@ self.UI.output(msg, targetStream=self.stream)
-class MaxLevelFilter(logging.Filter): +class MaxLevelFilter():
"""Filter that only passes records at or below a specific level.
- (setting handler level only passes records at or *above* a specified level, - so this provides the opposite functionality) + .. note:: setting handler level only passes records at or *above* a + specified level, so this provides the opposite functionality.
"""
pywikibot-commits@lists.wikimedia.org