diff options
author | Ivan Alejandro <ivanalejandro0@yahoo.com.ar> | 2013-06-14 12:51:18 -0300 |
---|---|---|
committer | Ivan Alejandro <ivanalejandro0@yahoo.com.ar> | 2013-06-14 13:02:06 -0300 |
commit | e6e88154f3b274ff97474a26a36dd6453f55de0b (patch) | |
tree | abec208d6e38a67173e43dd516db1a9c82f6bcac /src | |
parent | 733343465354e52e33dfe14aca54ebb7b786f5dd (diff) |
Bugfix: add logs to history. Closes #2871.
Diffstat (limited to 'src')
-rw-r--r-- | src/leap/util/leap_log_handler.py | 9 |
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) |