aboutsummaryrefslogtreecommitdiffstats
path: root/dpd/src/ExtractStatistic.py
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2017-12-29 06:43:49 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2017-12-29 06:43:58 +0100
commita62e05c9564045044df734fd3723b3f665ad91ae (patch)
tree5a9e1570362fe9a47fe581c292f3bd84f6fd3e82 /dpd/src/ExtractStatistic.py
parentbf53849fba5796d1b98254a7eeab575a50ae7996 (diff)
downloaddabmod-a62e05c9564045044df734fd3723b3f665ad91ae.tar.gz
dabmod-a62e05c9564045044df734fd3723b3f665ad91ae.tar.bz2
dabmod-a62e05c9564045044df734fd3723b3f665ad91ae.zip
DPD: Make logging to file optional in all modules, simplify apply_adapt_dumps
Diffstat (limited to 'dpd/src/ExtractStatistic.py')
-rw-r--r--dpd/src/ExtractStatistic.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/dpd/src/ExtractStatistic.py b/dpd/src/ExtractStatistic.py
index d27cd77..e917909 100644
--- a/dpd/src/ExtractStatistic.py
+++ b/dpd/src/ExtractStatistic.py
@@ -12,8 +12,10 @@ import matplotlib.pyplot as plt
import datetime
import os
import logging
-
-logging_path = os.path.dirname(logging.getLoggerClass().root.handlers[0].baseFilename)
+try:
+ logging_path = os.path.dirname(logging.getLoggerClass().root.handlers[0].baseFilename)
+except AttributeError:
+ logging_path = None
def _check_input_extract(tx_dpd, rx_received):
@@ -64,7 +66,7 @@ class ExtractStatistic:
self.plot = c.ES_plot
def _plot_and_log(self, tx_values, rx_values, phase_diffs_values, phase_diffs_values_lists):
- if logging.getLogger().getEffectiveLevel() == logging.DEBUG and self.plot:
+ if logging.getLogger().getEffectiveLevel() == logging.DEBUG and self.plot and logging_path is not None:
dt = datetime.datetime.now().isoformat()
fig_path = logging_path + "/" + dt + "_ExtractStatistic.png"