summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/core
diff options
context:
space:
mode:
authordrebs <drebs@riseup.net>2016-11-06 12:58:01 -0200
committerdrebs <drebs@riseup.net>2016-11-06 14:21:13 -0200
commit501005d7d54bd57a37df4777154f0e47e4dc622c (patch)
tree72ffd31c544faac1e27e84e8199997b3bb8851c4 /src/leap/bitmask/core
parent0ed9a016f6b41600f6bfc7b6576f152e6bf6a902 (diff)
[feat] increase verbosity using command line
Diffstat (limited to 'src/leap/bitmask/core')
-rw-r--r--src/leap/bitmask/core/bitmaskd.tac3
-rw-r--r--src/leap/bitmask/core/flags.py1
-rw-r--r--src/leap/bitmask/core/launcher.py2
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(),