summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/logs/log_silencer.py
diff options
context:
space:
mode:
authorIvan Alejandro <ivanalejandro0@gmail.com>2015-06-05 13:36:51 -0300
committerIvan Alejandro <ivanalejandro0@gmail.com>2015-06-22 15:52:37 -0300
commit584a6d93ad1fe1ba46929108f002a16a8b70e95d (patch)
tree966ad07fdbe9cff29911dacbcdc750f75a92bd87 /src/leap/bitmask/logs/log_silencer.py
parent8752f7f03a04ca7fa1169885adc9dbfce8bebbd4 (diff)
[feat] add a zmq based logger, change log window
- Add a new handler for a zmq/thread-safe log send between components. - Update the log window to use this new handler. - Remove old custom handler We have implemented a new handler that uses logbook, so this one is no longer needed. - Adapt log silencer to new handler - Use log file always as default - Related: #6733
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