mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Add ability to toggle log filter
To test the output of warning functions it can be useful to disable the log filter, producing the expected output instead of the limited output that is used during normal operation.
This commit is contained in:
parent
661ee49eda
commit
a69f4294bc
1 changed files with 6 additions and 0 deletions
|
|
@ -167,6 +167,12 @@ class LimitLogger(SafeLogger):
|
|||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(LimitLogger, self).__init__(*args, **kwargs)
|
||||
self.enable_filter()
|
||||
|
||||
def disable_filter(self):
|
||||
self.removeFilter(LimitLogger.limit_filter)
|
||||
|
||||
def enable_filter(self):
|
||||
self.addFilter(LimitLogger.limit_filter)
|
||||
|
||||
logging.setLoggerClass(LimitLogger)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue