From 535e584ba978a7a234a52df14f89197fbc3cea14 Mon Sep 17 00:00:00 2001 From: kali Date: Wed, 5 Sep 2012 07:59:35 +0900 Subject: openvpn messages log to eip.openvpn logger so we can get them to file / stdout even if our log viewer is not launched. --- src/leap/baseapp/log.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/leap/baseapp/log.py') diff --git a/src/leap/baseapp/log.py b/src/leap/baseapp/log.py index 0c98eb94..3580e987 100644 --- a/src/leap/baseapp/log.py +++ b/src/leap/baseapp/log.py @@ -1,6 +1,10 @@ +import logging + from PyQt4 import QtGui from PyQt4 import QtCore +vpnlogger = logging.getLogger('leap.openvpn') + class LogPane(object): """ @@ -56,5 +60,7 @@ class LogPane(object): """ simple slot: writes new line to logger Pane. """ + msg = line[:-1] if self.debugmode: - self.logbrowser.append(line[:-1]) + self.logbrowser.append(msg) + vpnlogger.info(msg) -- cgit v1.2.3 From 8148bc9c8c113c41fcb18b397669b1f13447c653 Mon Sep 17 00:00:00 2001 From: kali Date: Thu, 6 Sep 2012 02:27:04 +0900 Subject: more generic error handler in EipConductorAppMixin documentation of the Exception Hierarchy and attributes. also a bit of general cleanup around error handling in conductor. Hopefully to be polished an abstracted to leap.base with time. not all errors are converted (and the old with_errors/ignoring errors) are still there, but we should be using this style of handlers from now on. wrapping up with this pseudo-feature for now. as we work on individual features we can mimick the exceptions that are working. --- src/leap/baseapp/log.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/leap/baseapp/log.py') diff --git a/src/leap/baseapp/log.py b/src/leap/baseapp/log.py index 3580e987..8a7f81c3 100644 --- a/src/leap/baseapp/log.py +++ b/src/leap/baseapp/log.py @@ -6,7 +6,7 @@ from PyQt4 import QtCore vpnlogger = logging.getLogger('leap.openvpn') -class LogPane(object): +class LogPaneMixin(object): """ a simple log pane that writes new lines as they come @@ -22,7 +22,6 @@ class LogPane(object): self.logbrowser = QtGui.QTextBrowser() startStopButton = QtGui.QPushButton("&Connect") - #startStopButton.clicked.connect(self.start_or_stopVPN) self.startStopButton = startStopButton logging_layout.addWidget(self.logbrowser) -- cgit v1.2.3