diff options
author | kali <kali@leap.se> | 2013-06-15 01:32:12 +0900 |
---|---|---|
committer | kali <kali@leap.se> | 2013-06-15 01:32:12 +0900 |
commit | 08cb76edd1708ab77e608876ed2812f8b242889f (patch) | |
tree | 009feaa6c5b5a8fb20d6be7fe9852d32f537e9bd /src/leap/util/leap_log_handler.py | |
parent | e6a181c13e8bf99a893b3e3881c13d2df23701a7 (diff) | |
parent | 0c335f73445eff39dcc6dd44805b54498b577404 (diff) |
Merge branch 'develop' of ssh://leap.se/leap_client into develop
Diffstat (limited to 'src/leap/util/leap_log_handler.py')
-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) |