summaryrefslogtreecommitdiff
path: root/src/leap/util/leap_log_handler.py
diff options
context:
space:
mode:
authorIvan Alejandro <ivanalejandro0@yahoo.com.ar>2013-06-25 11:37:36 -0300
committerIvan Alejandro <ivanalejandro0@yahoo.com.ar>2013-06-25 11:39:46 -0300
commit36657c76b4c8511d5938dc6b81fde34c833ab7c7 (patch)
tree26059aa8f93ed5aa92502ebb1d78e76bf39983fb /src/leap/util/leap_log_handler.py
parent3c85990cf6fb9f6f9e593d562e121b6659f2bf88 (diff)
Change method for 'dependency injection' in test.
Diffstat (limited to 'src/leap/util/leap_log_handler.py')
-rw-r--r--src/leap/util/leap_log_handler.py6
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)