summaryrefslogtreecommitdiff
path: root/src/leap/baseapp
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-09-05 07:42:10 +0900
committerkali <kali@leap.se>2012-09-05 07:42:10 +0900
commita2804c3de1470db98d8c6aa8a01e2de1aa1718a1 (patch)
tree3743e172e4b7a1e0a2b0650d95950149f66e9ec3 /src/leap/baseapp
parent6ef92e257ce1e605194cb26ff6cb804c7d2c3418 (diff)
app wide logging handler
Diffstat (limited to 'src/leap/baseapp')
-rw-r--r--src/leap/baseapp/eip.py9
-rw-r--r--src/leap/baseapp/leap_app.py6
-rw-r--r--src/leap/baseapp/mainwindow.py5
3 files changed, 15 insertions, 5 deletions
diff --git a/src/leap/baseapp/eip.py b/src/leap/baseapp/eip.py
index 029ce0ba..e0da63a2 100644
--- a/src/leap/baseapp/eip.py
+++ b/src/leap/baseapp/eip.py
@@ -1,3 +1,4 @@
+import logging
import time
from PyQt4 import QtCore
@@ -7,6 +8,8 @@ from leap.baseapp import constants
from leap.eip import exceptions as eip_exceptions
from leap.eip.eipconnection import EIPConnection
+logger = logging.getLogger(name=__name__)
+
class EIPConductorApp(object):
"""
@@ -126,8 +129,10 @@ class EIPConductorApp(object):
if self.conductor.with_errors:
#XXX how to wait on pkexec???
#something better that this workaround, plz!!
- time.sleep(2)
- print('errors. disconnect.')
+ time.sleep(5)
+ #print('errors. disconnect.')
+ logger.debug('timeout')
+ logger.error('errors. disconnect')
self.start_or_stopVPN() # is stop
state = self.conductor.poll_connection_state()
diff --git a/src/leap/baseapp/leap_app.py b/src/leap/baseapp/leap_app.py
index def95da1..85644360 100644
--- a/src/leap/baseapp/leap_app.py
+++ b/src/leap/baseapp/leap_app.py
@@ -1,7 +1,11 @@
+import logging
+
from PyQt4 import QtGui
from leap.gui import mainwindow_rc
+logger = logging.getLogger(name=__name__)
+
class MainWindow(object):
"""
@@ -79,5 +83,7 @@ technolust</i>")
# TODO:make sure to shutdown all child process / threads
# in conductor
# XXX send signal instead?
+ logger.info('Shutting down')
self.conductor.cleanup()
+ logger.info('Exiting')
QtGui.qApp.quit()
diff --git a/src/leap/baseapp/mainwindow.py b/src/leap/baseapp/mainwindow.py
index ac7fe9c4..e87f5844 100644
--- a/src/leap/baseapp/mainwindow.py
+++ b/src/leap/baseapp/mainwindow.py
@@ -1,9 +1,6 @@
# vim: set fileencoding=utf-8 :
#!/usr/bin/env python
import logging
-logging.basicConfig()
-logger = logging.getLogger(name=__name__)
-logger.setLevel(logging.DEBUG)
from PyQt4 import QtCore
from PyQt4 import QtGui
@@ -13,6 +10,8 @@ from leap.baseapp.log import LogPane
from leap.baseapp.systray import StatusAwareTrayIcon
from leap.baseapp.leap_app import MainWindow
+logger = logging.getLogger(name=__name__)
+
class LeapWindow(QtGui.QMainWindow,
MainWindow, EIPConductorApp,