diff options
Diffstat (limited to 'src/leap/bitmask/core')
-rw-r--r-- | src/leap/bitmask/core/bitmaskd.tac | 3 | ||||
-rw-r--r-- | src/leap/bitmask/core/flags.py | 1 | ||||
-rw-r--r-- | src/leap/bitmask/core/launcher.py | 2 |
3 files changed, 5 insertions, 1 deletions
diff --git a/src/leap/bitmask/core/bitmaskd.tac b/src/leap/bitmask/core/bitmaskd.tac index 0ab44ff3..e2733f94 100644 --- a/src/leap/bitmask/core/bitmaskd.tac +++ b/src/leap/bitmask/core/bitmaskd.tac @@ -12,6 +12,7 @@ from twisted.logger import LogLevel from twisted.logger import LogLevelFilterPredicate from twisted.logger import formatEventAsClassicLogText as formatEvent +from leap.bitmask.core import flags from leap.bitmask.core.service import BitmaskBackend from leap.bitmask.core.logs import logFileFactory @@ -21,7 +22,7 @@ application = service.Application("bitmaskd") # configure logging log_file = logFileFactory() file_observer = FileLogObserver(log_file, formatEvent) -level = LogLevel.debug if os.environ.get('BITMASK_DEBUG') else LogLevel.info +level = LogLevel.debug if flags.VERBOSE else LogLevel.info predicate = LogLevelFilterPredicate(defaultLogLevel=level) observer = FilteringLogObserver(file_observer, [predicate]) application.setComponent(ILogObserver, observer) diff --git a/src/leap/bitmask/core/flags.py b/src/leap/bitmask/core/flags.py index 9a40c70c..12905d3d 100644 --- a/src/leap/bitmask/core/flags.py +++ b/src/leap/bitmask/core/flags.py @@ -1 +1,2 @@ BACKEND = 'default' +VERBOSE = False diff --git a/src/leap/bitmask/core/launcher.py b/src/leap/bitmask/core/launcher.py index a02cb23b..d77f367a 100644 --- a/src/leap/bitmask/core/launcher.py +++ b/src/leap/bitmask/core/launcher.py @@ -50,6 +50,8 @@ def run_bitmaskd(): for (index, arg) in enumerate(sys.argv): if arg == '--backend': flags.BACKEND = sys.argv[index + 1] + elif arg == '--verbose': + flags.VERBOSE = True args = [ '-y', join(here(core), "bitmaskd.tac"), '--logfile', getLogPath(), |