diff options
author | Tomás Touceda <chiiph@leap.se> | 2013-06-25 14:54:41 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@leap.se> | 2013-06-25 14:54:41 -0300 |
commit | a5a51bcc1573d7b7cf281a4d8ac142705bd227d0 (patch) | |
tree | 8919f23f1f78e13e9696022a52a669ca8db15558 /src/leap/util/leap_log_handler.py | |
parent | 3c85990cf6fb9f6f9e593d562e121b6659f2bf88 (diff) | |
parent | 16ea8b5d78c990e75367d405619c55272ecf09e6 (diff) |
Merge remote-tracking branch 'ivan/feature/2982_test_leap_log_handler' into develop
Diffstat (limited to 'src/leap/util/leap_log_handler.py')
-rw-r--r-- | src/leap/util/leap_log_handler.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/leap/util/leap_log_handler.py b/src/leap/util/leap_log_handler.py index e5bc87e1..271096d3 100644 --- a/src/leap/util/leap_log_handler.py +++ b/src/leap/util/leap_log_handler.py @@ -44,7 +44,7 @@ class LogHandler(logging.Handler): logging.Handler.__init__(self) self._qtsignal = qtsignal - def _set_format(self, logging_level): + def _get_format(self, logging_level): """ Sets the log format depending on the parameter. It uses html and css to set the colors for the logs. @@ -70,7 +70,7 @@ class LogHandler(logging.Handler): log_format = ' - '.join(format_attrs) formatter = logging.Formatter(log_format) - self.setFormatter(formatter) + return formatter def emit(self, logRecord): """ @@ -82,7 +82,7 @@ class LogHandler(logging.Handler): :param logRecord: the record emitted by the logging module. :type logRecord: logging.LogRecord. """ - self._set_format(logRecord.levelname) + self.setFormatter(self._get_format(logRecord.levelname)) log = self.format(logRecord) log_item = {self.RECORD_KEY: logRecord, self.MESSAGE_KEY: log} self._log_history.append(log_item) |