summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/core
diff options
context:
space:
mode:
authorKali Kaneko (leap communications) <kali@leap.se>2016-09-27 16:38:18 -0400
committerKali Kaneko (leap communications) <kali@leap.se>2016-09-27 16:48:58 -0400
commit125c711cd5b6faa4e6d62d18dde61dac90471f39 (patch)
treebc9f5944e0317e5e2319bf3c9c591f286ccc6204 /src/leap/bitmask/core
parentaefa2d446c1641a92c8074374919fd796ed17202 (diff)
[bug] create config dir if it does not exist
Diffstat (limited to 'src/leap/bitmask/core')
-rw-r--r--src/leap/bitmask/core/logs.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/leap/bitmask/core/logs.py b/src/leap/bitmask/core/logs.py
index 2b42d61..b8ba3ba 100644
--- a/src/leap/bitmask/core/logs.py
+++ b/src/leap/bitmask/core/logs.py
@@ -1,3 +1,4 @@
+from os import makedirs
from os.path import abspath, join, isfile
from twisted.python import logfile
@@ -6,6 +7,9 @@ from leap.common.config import get_path_prefix
def loggerFactory():
+ configdir = abspath(join(get_path_prefix(), 'leap'))
+ if not configdir:
+ makedirs(configdir)
log_path = abspath(join(get_path_prefix(), 'leap', 'bitmaskd.log'))
rotate = isfile(log_path)
_logfile = logfile.LogFile.fromFullPath(log_path, maxRotatedFiles=5)