summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/logs/log_silencer.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/bitmask/logs/log_silencer.py')
-rw-r--r--src/leap/bitmask/logs/log_silencer.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/leap/bitmask/logs/log_silencer.py b/src/leap/bitmask/logs/log_silencer.py
index 56b290e4..540532cb 100644
--- a/src/leap/bitmask/logs/log_silencer.py
+++ b/src/leap/bitmask/logs/log_silencer.py
@@ -17,14 +17,13 @@
"""
Filter for leap logs.
"""
-import logging
import os
import re
from leap.bitmask.util import get_path_prefix
-class SelectiveSilencerFilter(logging.Filter):
+class SelectiveSilencerFilter(object):
"""
Configurable filter for root leap logger.
@@ -75,7 +74,7 @@ class SelectiveSilencerFilter(logging.Filter):
return map(lambda line: re.sub('\s', '', line),
lines)
- def filter(self, record):
+ def filter(self, record, handler):
"""
Implements the filter functionality for this Filter
@@ -86,7 +85,10 @@ class SelectiveSilencerFilter(logging.Filter):
"""
if not self.rules:
return True
- logger_path = record.name
+ logger_path = record.module
+ if logger_path is None:
+ return True
+
for path in self.rules:
if logger_path.startswith(path):
return False