summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-06-14 13:05:49 -0300
committerTomás Touceda <chiiph@leap.se>2013-06-14 13:05:49 -0300
commit0c335f73445eff39dcc6dd44805b54498b577404 (patch)
tree931e9a11f59e7ed85b7b6ab608302a958d2baa8a
parente9b8b51e71be82a2e0a7ac7b431d13b96b2ea178 (diff)
parente6e88154f3b274ff97474a26a36dd6453f55de0b (diff)
Merge remote-tracking branch 'ivan/bug/2871_fix-logger-history' into develop
-rw-r--r--src/leap/util/leap_log_handler.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/leap/util/leap_log_handler.py b/src/leap/util/leap_log_handler.py
index 5b8ae789..e5bc87e1 100644
--- a/src/leap/util/leap_log_handler.py
+++ b/src/leap/util/leap_log_handler.py
@@ -31,16 +31,16 @@ class LogHandler(logging.Handler):
MESSAGE_KEY = 'message'
RECORD_KEY = 'record'
- # TODO This is going to eat lots of memory after some time.
- # Should be pruned at some moment.
- _log_history = []
-
def __init__(self, qtsignal):
"""
LogHander initialization.
Calls parent method and keeps a reference to the qtsignal
that will be used to fire the gui update.
"""
+ # TODO This is going to eat lots of memory after some time.
+ # Should be pruned at some moment.
+ self._log_history = []
+
logging.Handler.__init__(self)
self._qtsignal = qtsignal
@@ -85,6 +85,7 @@ class LogHandler(logging.Handler):
self._set_format(logRecord.levelname)
log = self.format(logRecord)
log_item = {self.RECORD_KEY: logRecord, self.MESSAGE_KEY: log}
+ self._log_history.append(log_item)
self._qtsignal(log_item)