summaryrefslogtreecommitdiff
path: root/bin/analyze-timing.py
diff options
context:
space:
mode:
Diffstat (limited to 'bin/analyze-timing.py')
-rwxr-xr-xbin/analyze-timing.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/analyze-timing.py b/bin/analyze-timing.py
index 9271787..6761e7b 100755
--- a/bin/analyze-timing.py
+++ b/bin/analyze-timing.py
@@ -75,6 +75,7 @@ Options:
import getopt
import json
+import logging
import re
import sys
from dfatool import plotter
@@ -186,6 +187,7 @@ if __name__ == "__main__":
"plot-unparam= plot-param= show-models= show-quality= "
"ignored-trace-indexes= discard-outliers= function-override= "
"filter-param= "
+ "log-level= "
"cross-validate= "
"corrcoef param-info "
"with-safe-functions hwmodel= export-energymodel="
@@ -238,6 +240,13 @@ if __name__ == "__main__":
else:
opt["filter-param"] = list()
+ if "log-level" in opt:
+ numeric_level = getattr(logging, opt["log-level"].upper(), None)
+ if not isinstance(numeric_level, int):
+ print(f"Invalid log level: {loglevel}", file=sys.stderr)
+ sys.exit(1)
+ logging.basicConfig(level=numeric_level)
+
except getopt.GetoptError as err:
print(err)
sys.exit(2)