summaryrefslogtreecommitdiffstats
path: root/dpd/src/ExtractStatistic.py
diff options
context:
space:
mode:
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"