summaryrefslogtreecommitdiffstats
path: root/dpd/main.py
diff options
context:
space:
mode:
authorandreas128 <Andreas>2017-08-21 20:23:17 +0200
committerandreas128 <Andreas>2017-08-21 20:23:17 +0200
commitd7521876d7cb221860b0975b2a25eedca00206b7 (patch)
treed32d46ba6baca93b59b53846a3f0335f6df5d508 /dpd/main.py
parent0c0d145866043c16c3dc73615f35bbac12140b93 (diff)
downloaddabmod-d7521876d7cb221860b0975b2a25eedca00206b7.tar.gz
dabmod-d7521876d7cb221860b0975b2a25eedca00206b7.tar.bz2
dabmod-d7521876d7cb221860b0975b2a25eedca00206b7.zip
Add logging directory creation for all log files
Diffstat (limited to 'dpd/main.py')
-rwxr-xr-xdpd/main.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/dpd/main.py b/dpd/main.py
index ae18182..72026dc 100755
--- a/dpd/main.py
+++ b/dpd/main.py
@@ -10,10 +10,16 @@
This engine calculates and updates the parameter of the digital
predistortion module of ODR-DabMod."""
+import datetime
+import os
+
import logging
+dt = datetime.datetime.now().isoformat()
+logging_path = "/tmp/dpd_{}".format(dt).replace(".","_").replace(":","-")
+os.makedirs(logging_path)
logging.basicConfig(format='%(asctime)s - %(module)s - %(levelname)s - %(message)s',
datefmt='%Y-%m-%d %H:%M:%S',
- filename='/tmp/dpd.log',
+ filename='{}/dpd.log'.format(logging_path),
filemode='w',
level=logging.DEBUG)