From e7bda574b308c08dc5a61941b850442c43a17bd4 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Mon, 22 Jun 2015 16:58:19 -0300 Subject: [bug] make sure log path exists The logger is the first thing to be created and on a first run the config path won't exist. This way we make sure the path always exists. --- src/leap/bitmask/logs/utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/leap') diff --git a/src/leap/bitmask/logs/utils.py b/src/leap/bitmask/logs/utils.py index d3aa322b..87d33876 100644 --- a/src/leap/bitmask/logs/utils.py +++ b/src/leap/bitmask/logs/utils.py @@ -28,12 +28,17 @@ from leap.bitmask.logs.safezmqhandler import SafeZMQHandler # from leap.bitmask.logs.streamtologger import StreamToLogger from leap.bitmask.platform_init import IS_WIN from leap.bitmask.util import get_path_prefix +from leap.common.files import mkdir_p import logbook from logbook.more import ColorizedStderrHandler -BITMASK_LOG_FILE = os.path.join(get_path_prefix(), "leap", 'bitmask.log') +# NOTE: make sure that the folder exists, the logger is created before saving +# settings on the first run. +_base = os.path.join(get_path_prefix(), "leap") +mkdir_p(_base) +BITMASK_LOG_FILE = os.path.join(_base, 'bitmask.log') def get_logger(perform_rollover=False): -- cgit v1.2.3