diff options
author | Kali Kaneko <kali@leap.se> | 2015-10-29 12:16:37 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2015-10-29 12:16:37 -0400 |
commit | 70a5608e618b97da97f9449ba738e0e67f99a937 (patch) | |
tree | c7adab1d684e885e00206c41e1599d8f6c036ac2 /src/leap/bitmask/frontend_app.py | |
parent | 3519a1a732bc298379e4946b7212bb153bd2f8a0 (diff) | |
parent | 639df4f63b16465003463ae9587ac982135ba3ac (diff) |
Merge tag '0.9.0' into debian/experimental
Tag leap.bitmask version 0.9.0
Diffstat (limited to 'src/leap/bitmask/frontend_app.py')
-rw-r--r-- | src/leap/bitmask/frontend_app.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/leap/bitmask/frontend_app.py b/src/leap/bitmask/frontend_app.py index fed24cfa..60391f50 100644 --- a/src/leap/bitmask/frontend_app.py +++ b/src/leap/bitmask/frontend_app.py @@ -31,10 +31,8 @@ from leap.bitmask.gui.mainwindow import MainWindow from leap.bitmask.logs.utils import get_logger from leap.bitmask.util import dict_to_flags -logger = get_logger() - -def signal_handler(window, pid, signum, frame): +def signal_handler(window, pid, logger, signum, frame): """ Signal handler that quits the running app cleanly. @@ -42,6 +40,8 @@ def signal_handler(window, pid, signum, frame): :type window: MainWindow :param pid: process id of the main process. :type pid: int + :param logger: the logger object to use for logging + :type logger: logbook.Logger :param signum: number of the signal received (e.g. SIGINT -> 2) :type signum: int :param frame: current stack frame @@ -70,6 +70,7 @@ def run_frontend(options, flags_dict, backend_pid=None): :type flags_dict: dict """ dict_to_flags(flags_dict) + logger = get_logger() start_hidden = options["start_hidden"] @@ -120,7 +121,7 @@ def run_frontend(options, flags_dict, backend_pid=None): window = MainWindow(start_hidden=start_hidden, backend_pid=backend_pid) my_pid = os.getpid() - sig_handler = partial(signal_handler, window, my_pid) + sig_handler = partial(signal_handler, window, my_pid, logger) signal.signal(signal.SIGINT, sig_handler) signal.signal(signal.SIGTERM, sig_handler) |