summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/bitmask/gui')
-rw-r--r--src/leap/bitmask/gui/advanced_key_management.py7
-rw-r--r--src/leap/bitmask/gui/app.py5
-rw-r--r--src/leap/bitmask/gui/eip_preferenceswindow.py5
-rw-r--r--src/leap/bitmask/gui/eip_status.py5
-rw-r--r--src/leap/bitmask/gui/login.py5
-rw-r--r--src/leap/bitmask/gui/mail_status.py5
-rw-r--r--src/leap/bitmask/gui/mainwindow.py32
-rw-r--r--src/leap/bitmask/gui/passwordwindow.py8
-rw-r--r--src/leap/bitmask/gui/preferences_account_page.py6
-rw-r--r--src/leap/bitmask/gui/preferences_email_page.py6
-rw-r--r--src/leap/bitmask/gui/preferenceswindow.py5
-rw-r--r--src/leap/bitmask/gui/signaltracker.py6
-rw-r--r--src/leap/bitmask/gui/statemachines.py5
-rw-r--r--src/leap/bitmask/gui/wizard.py4
14 files changed, 38 insertions, 66 deletions
diff --git a/src/leap/bitmask/gui/advanced_key_management.py b/src/leap/bitmask/gui/advanced_key_management.py
index 7d147b7b..2e315d18 100644
--- a/src/leap/bitmask/gui/advanced_key_management.py
+++ b/src/leap/bitmask/gui/advanced_key_management.py
@@ -17,14 +17,13 @@
"""
Advanced Key Management
"""
-import logging
-
-from PySide import QtCore, QtGui
+from PySide import QtGui
+from leap.bitmask.logs.utils import get_logger
from leap.bitmask.services import get_service_display_name, MX_SERVICE
from ui_advanced_key_management import Ui_AdvancedKeyManagement
-logger = logging.getLogger(__name__)
+logger = get_logger()
class AdvancedKeyManagement(QtGui.QDialog):
diff --git a/src/leap/bitmask/gui/app.py b/src/leap/bitmask/gui/app.py
index 46f276e1..02357b2b 100644
--- a/src/leap/bitmask/gui/app.py
+++ b/src/leap/bitmask/gui/app.py
@@ -18,15 +18,14 @@ A single App instances holds the signals that are shared among different
frontend UI components. The App also keeps a reference to the backend object
and the signaler get signals from the backend.
"""
-import logging
-
from PySide import QtCore, QtGui
from leap.bitmask.config.leapsettings import LeapSettings
from leap.bitmask.backend.backend_proxy import BackendProxy
from leap.bitmask.backend.leapsignaler import LeapSignaler
+from leap.bitmask.logs.utils import get_logger
-logger = logging.getLogger(__name__)
+logger = get_logger()
class App(QtGui.QWidget):
diff --git a/src/leap/bitmask/gui/eip_preferenceswindow.py b/src/leap/bitmask/gui/eip_preferenceswindow.py
index 8939c709..756e8adf 100644
--- a/src/leap/bitmask/gui/eip_preferenceswindow.py
+++ b/src/leap/bitmask/gui/eip_preferenceswindow.py
@@ -18,15 +18,14 @@
"""
EIP Preferences window
"""
-import logging
-
from functools import partial
from PySide import QtCore, QtGui
from leap.bitmask.config.leapsettings import LeapSettings
+from leap.bitmask.logs.utils import get_logger
from leap.bitmask.gui.ui_eippreferences import Ui_EIPPreferences
-logger = logging.getLogger(__name__)
+logger = get_logger()
class EIPPreferencesWindow(QtGui.QDialog):
diff --git a/src/leap/bitmask/gui/eip_status.py b/src/leap/bitmask/gui/eip_status.py
index 83490cac..8334c2ee 100644
--- a/src/leap/bitmask/gui/eip_status.py
+++ b/src/leap/bitmask/gui/eip_status.py
@@ -17,13 +17,12 @@
"""
EIP Status Panel widget implementation
"""
-import logging
-
from datetime import datetime
from functools import partial
from PySide import QtCore, QtGui
+from leap.bitmask.logs.utils import get_logger
from leap.bitmask.services import get_service_display_name, EIP_SERVICE
from leap.bitmask.platform_init import IS_LINUX
from leap.bitmask.util.averages import RateMovingAverage
@@ -32,7 +31,7 @@ from leap.common.check import leap_assert_type
from ui_eip_status import Ui_EIPStatus
QtDelayedCall = QtCore.QTimer.singleShot
-logger = logging.getLogger(__name__)
+logger = get_logger()
class EIPStatusWidget(QtGui.QWidget):
diff --git a/src/leap/bitmask/gui/login.py b/src/leap/bitmask/gui/login.py
index 716a8609..756dd63c 100644
--- a/src/leap/bitmask/gui/login.py
+++ b/src/leap/bitmask/gui/login.py
@@ -30,8 +30,6 @@ The login sequence is the following:
- on success: _authentication_finished
"""
-import logging
-
from keyring.errors import InitError as KeyringInitError
from PySide import QtCore, QtGui
from ui_login import Ui_LoginWidget
@@ -41,6 +39,7 @@ from ui_login import Ui_LoginWidget
from leap.bitmask.backend.leapbackend import ERROR_KEY, PASSED_KEY
from leap.bitmask.config import flags
from leap.bitmask.config.leapsettings import LeapSettings
+from leap.bitmask.logs.utils import get_logger
from leap.bitmask.gui.signaltracker import SignalTracker
from leap.bitmask.util import make_address
from leap.bitmask.util.credentials import USERNAME_REGEX
@@ -48,7 +47,7 @@ from leap.bitmask.util.keyring_helpers import has_keyring
from leap.bitmask.util.keyring_helpers import get_keyring
from leap.common.check import leap_assert_type
-logger = logging.getLogger(__name__)
+logger = get_logger()
class LoginState(object):
diff --git a/src/leap/bitmask/gui/mail_status.py b/src/leap/bitmask/gui/mail_status.py
index a3a1be37..b5d1df81 100644
--- a/src/leap/bitmask/gui/mail_status.py
+++ b/src/leap/bitmask/gui/mail_status.py
@@ -17,10 +17,9 @@
"""
Mail Status Panel widget implementation
"""
-import logging
-
from PySide import QtCore, QtGui
+from leap.bitmask.logs.utils import get_logger
from leap.bitmask.platform_init import IS_LINUX
from leap.bitmask.services import get_service_display_name, MX_SERVICE
from leap.common.check import leap_assert, leap_assert_type
@@ -29,7 +28,7 @@ from leap.common.events import catalog
from ui_mail_status import Ui_MailStatusWidget
-logger = logging.getLogger(__name__)
+logger = get_logger()
class MailStatusWidget(QtGui.QWidget):
diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py
index 0df6ef84..a2cf7bca 100644
--- a/src/leap/bitmask/gui/mainwindow.py
+++ b/src/leap/bitmask/gui/mainwindow.py
@@ -17,7 +17,6 @@
"""
Main window for Bitmask.
"""
-import logging
import time
from datetime import datetime
@@ -34,10 +33,11 @@ from leap.bitmask import __version_hash__ as VERSION_HASH
from leap.bitmask.backend.leapbackend import ERROR_KEY, PASSED_KEY
from leap.bitmask.config import flags
+from leap.bitmask.logs.utils import get_logger
from leap.bitmask.gui.advanced_key_management import AdvancedKeyManagement
from leap.bitmask.gui.eip_status import EIPStatusWidget
-from leap.bitmask.gui.loggerwindow import LoggerWindow
+from leap.bitmask.gui.logwindow import LoggerWindow
from leap.bitmask.gui.login import LoginWidget
from leap.bitmask.gui.mail_status import MailStatusWidget
from leap.bitmask.gui.preferenceswindow import PreferencesWindow
@@ -60,7 +60,6 @@ from leap.bitmask.services import EIP_SERVICE, MX_SERVICE
from leap.bitmask.util import autostart, make_address
from leap.bitmask.util.keyring_helpers import has_keyring
-from leap.bitmask.logs.leap_log_handler import LeapLogHandler
from leap.common.events import register
from leap.common.events import catalog
@@ -70,7 +69,8 @@ from leap.mail.imap.service.imap import IMAP_PORT
from ui_mainwindow import Ui_MainWindow
QtDelayedCall = QtCore.QTimer.singleShot
-logger = logging.getLogger(__name__)
+
+logger = get_logger()
class MainWindow(QtGui.QMainWindow, SignalTracker):
@@ -492,21 +492,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker):
self._wizard = None
- def _get_leap_logging_handler(self):
- """
- Gets the leap handler from the top level logger
-
- :return: a logging handler or None
- :rtype: LeapLogHandler or None
- """
- # TODO this can be a function, does not need
- # to be a method.
- leap_logger = logging.getLogger('leap')
- for h in leap_logger.handlers:
- if isinstance(h, LeapLogHandler):
- return h
- return None
-
def _show_logger_window(self):
"""
TRIGGERS:
@@ -515,13 +500,8 @@ class MainWindow(QtGui.QMainWindow, SignalTracker):
Display the window with the history of messages logged until now
and displays the new ones on arrival.
"""
- leap_log_handler = self._get_leap_logging_handler()
- if leap_log_handler is None:
- logger.error('Leap logger handler not found')
- return
- else:
- lw = LoggerWindow(self, handler=leap_log_handler)
- lw.show()
+ lw = LoggerWindow(self)
+ lw.show()
def _show_AKM(self):
"""
diff --git a/src/leap/bitmask/gui/passwordwindow.py b/src/leap/bitmask/gui/passwordwindow.py
index 88565829..94cf25da 100644
--- a/src/leap/bitmask/gui/passwordwindow.py
+++ b/src/leap/bitmask/gui/passwordwindow.py
@@ -19,14 +19,14 @@
Change password dialog window
"""
-from PySide import QtCore, QtGui
-from leap.bitmask.util.credentials import password_checks
+from PySide import QtGui
+from leap.bitmask.logs.utils import get_logger
+from leap.bitmask.util.credentials import password_checks
from leap.bitmask.gui.ui_password_change import Ui_PasswordChange
from leap.bitmask.gui.flashable import Flashable
-import logging
-logger = logging.getLogger(__name__)
+logger = get_logger()
class PasswordWindow(QtGui.QDialog, Flashable):
diff --git a/src/leap/bitmask/gui/preferences_account_page.py b/src/leap/bitmask/gui/preferences_account_page.py
index cab90eec..5661fb66 100644
--- a/src/leap/bitmask/gui/preferences_account_page.py
+++ b/src/leap/bitmask/gui/preferences_account_page.py
@@ -16,16 +16,16 @@
"""
Widget for "account" preferences
"""
-import logging
-
from functools import partial
from PySide import QtCore, QtGui
+
+from leap.bitmask.logs.utils import get_logger
from leap.bitmask.gui.ui_preferences_account_page import Ui_PreferencesAccountPage
from leap.bitmask.gui.passwordwindow import PasswordWindow
from leap.bitmask.services import get_service_display_name
-logger = logging.getLogger(__name__)
+logger = get_logger()
class PreferencesAccountPage(QtGui.QWidget):
diff --git a/src/leap/bitmask/gui/preferences_email_page.py b/src/leap/bitmask/gui/preferences_email_page.py
index 80e8d93e..3087f343 100644
--- a/src/leap/bitmask/gui/preferences_email_page.py
+++ b/src/leap/bitmask/gui/preferences_email_page.py
@@ -16,12 +16,12 @@
"""
Widget for "email" preferences
"""
-import logging
+from PySide import QtGui
-from PySide import QtCore, QtGui
+from leap.bitmask.logs.utils import get_logger
from leap.bitmask.gui.ui_preferences_email_page import Ui_PreferencesEmailPage
-logger = logging.getLogger(__name__)
+logger = get_logger()
class PreferencesEmailPage(QtGui.QWidget):
diff --git a/src/leap/bitmask/gui/preferenceswindow.py b/src/leap/bitmask/gui/preferenceswindow.py
index daad08b0..a71f4e5c 100644
--- a/src/leap/bitmask/gui/preferenceswindow.py
+++ b/src/leap/bitmask/gui/preferenceswindow.py
@@ -18,18 +18,17 @@
"""
Preferences window
"""
-import logging
-
from PySide import QtCore, QtGui
from leap.bitmask.services import EIP_SERVICE, MX_SERVICE
+from leap.bitmask.logs.utils import get_logger
from leap.bitmask.gui.ui_preferences import Ui_Preferences
from leap.bitmask.gui.preferences_account_page import PreferencesAccountPage
from leap.bitmask.gui.preferences_vpn_page import PreferencesVpnPage
from leap.bitmask.gui.preferences_email_page import PreferencesEmailPage
-logger = logging.getLogger(__name__)
+logger = get_logger()
class PreferencesWindow(QtGui.QDialog):
diff --git a/src/leap/bitmask/gui/signaltracker.py b/src/leap/bitmask/gui/signaltracker.py
index 0e3b2dce..3dfcfe18 100644
--- a/src/leap/bitmask/gui/signaltracker.py
+++ b/src/leap/bitmask/gui/signaltracker.py
@@ -14,11 +14,11 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import logging
-
from PySide import QtCore
-logger = logging.getLogger(__name__)
+from leap.bitmask.logs.utils import get_logger
+
+logger = get_logger()
class SignalTracker(QtCore.QObject):
diff --git a/src/leap/bitmask/gui/statemachines.py b/src/leap/bitmask/gui/statemachines.py
index 91f1f605..ab48b756 100644
--- a/src/leap/bitmask/gui/statemachines.py
+++ b/src/leap/bitmask/gui/statemachines.py
@@ -17,16 +17,15 @@
"""
State machines for the Bitmask app.
"""
-import logging
-
from PySide import QtCore
from PySide.QtCore import QStateMachine, QState, Signal
from PySide.QtCore import QObject
from leap.bitmask.services import connections
from leap.common.check import leap_assert_type
+from leap.bitmask.logs.utils import get_logger
-logger = logging.getLogger(__name__)
+logger = get_logger()
_tr = QObject().tr
diff --git a/src/leap/bitmask/gui/wizard.py b/src/leap/bitmask/gui/wizard.py
index c66c6269..c60d967b 100644
--- a/src/leap/bitmask/gui/wizard.py
+++ b/src/leap/bitmask/gui/wizard.py
@@ -17,7 +17,6 @@
"""
First run wizard
"""
-import logging
import random
from functools import partial
@@ -30,6 +29,7 @@ from leap.bitmask.backend.leapbackend import ERROR_KEY, PASSED_KEY
from leap.bitmask.config import flags
from leap.bitmask.config.leapsettings import LeapSettings
+from leap.bitmask.logs.utils import get_logger
from leap.bitmask.gui.signaltracker import SignalTracker
from leap.bitmask.services import get_service_display_name, get_supported
from leap.bitmask.util.credentials import password_checks, username_checks
@@ -39,7 +39,7 @@ from leap.bitmask.util.keyring_helpers import has_keyring
from ui_wizard import Ui_Wizard
QtDelayedCall = QtCore.QTimer.singleShot
-logger = logging.getLogger(__name__)
+logger = get_logger()
class Wizard(QtGui.QWizard, SignalTracker):