summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/gui
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2013-09-11 15:53:55 +0200
committerKali Kaneko <kali@leap.se>2013-09-11 15:53:55 +0200
commitdd489b4785b2a534e7a1a70027b38bb42c2470c7 (patch)
tree69121f4ab2b6546ce42c78c3032398aa52aa596c /src/leap/bitmask/gui
parent55190af15f83d22ca3427d941714bb0b59e8b1cf (diff)
parentb0cc3f3096db324a9e4106556b5c5718d5e1c2b5 (diff)
Merge remote-tracking branch 'ivan-github/bug/3714_fix-logger-saving-several-line-returns' into develop
Diffstat (limited to 'src/leap/bitmask/gui')
-rw-r--r--src/leap/bitmask/gui/loggerwindow.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/leap/bitmask/gui/loggerwindow.py b/src/leap/bitmask/gui/loggerwindow.py
index ece4cad6..ad2ceded 100644
--- a/src/leap/bitmask/gui/loggerwindow.py
+++ b/src/leap/bitmask/gui/loggerwindow.py
@@ -91,7 +91,6 @@ class LoggerWindow(QtGui.QDialog):
}
level = log[LeapLogHandler.RECORD_KEY].levelno
message = log[LeapLogHandler.MESSAGE_KEY]
- message = message.replace('\n', '<br>\n')
if self._logs_to_display[level]:
open_tag = "<tr style='" + html_style[level] + "'>"
@@ -152,8 +151,13 @@ class LoggerWindow(QtGui.QDialog):
if fileName:
try:
with open(fileName, 'w') as output:
- output.write(self.ui.txtLogHistory.toPlainText())
- output.write('\n')
+ history = self.ui.txtLogHistory.toPlainText()
+ # Chop some \n.
+ # html->plain adds several \n because the html is made
+ # using table cells.
+ history = history.replace('\n\n\n', '\n')
+
+ output.write(history)
logger.debug('Log saved in %s' % (fileName, ))
except IOError, e:
logger.error("Error saving log file: %r" % (e, ))