mirror of https://github.com/fail2ban/fail2ban
some logging level got changed between 0.10/0.11 (9 is lowest log level to capture messages in LogCaptureTestCase now)
parent
587e4ff573
commit
ac41b8f3be
|
@ -1008,7 +1008,7 @@ class CommandAction(ActionBase):
|
|||
RuntimeError
|
||||
If command execution times out.
|
||||
"""
|
||||
if logSys.getEffectiveLevel() < logging.DEBUG: # pragma: no cover
|
||||
if logSys.getEffectiveLevel() < logging.DEBUG:
|
||||
logSys.log(9, realCmd)
|
||||
if not realCmd:
|
||||
logSys.debug("Nothing to do")
|
||||
|
|
|
@ -754,10 +754,11 @@ class LogCaptureTestCase(unittest.TestCase):
|
|||
# Let's log everything into a string
|
||||
self._log = LogCaptureTestCase._MemHandler(unittest.F2B.log_lazy)
|
||||
logSys.handlers = [self._log]
|
||||
if self._old_level <= logging.DEBUG:
|
||||
# lowest log level to capture messages (expected in tests) is Lev.9
|
||||
if self._old_level <= logging.DEBUG: # pragma: no cover
|
||||
logSys.handlers += self._old_handlers
|
||||
else: # lowest log level to capture messages
|
||||
logSys.setLevel(logging.DEBUG)
|
||||
if self._old_level > logging.DEBUG-1:
|
||||
logSys.setLevel(logging.DEBUG-1)
|
||||
super(LogCaptureTestCase, self).setUp()
|
||||
|
||||
def tearDown(self):
|
||||
|
|
Loading…
Reference in New Issue