diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2020-12-01 14:07:56 +0100 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2020-12-01 14:07:56 +0100 |
commit | 55492bda9459152af3c0ea76c9b94aba97b09053 (patch) | |
tree | 4e1f29d4d30f0ce0c0a37da533e83dac043b892f /bin/generate-dfa-benchmark.py | |
parent | e90a18db341ff061709869bb1dac24318fef1463 (diff) |
runner, harness: add logging support and debug output
Diffstat (limited to 'bin/generate-dfa-benchmark.py')
-rwxr-xr-x | bin/generate-dfa-benchmark.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/generate-dfa-benchmark.py b/bin/generate-dfa-benchmark.py index 98c3602..50f5e58 100755 --- a/bin/generate-dfa-benchmark.py +++ b/bin/generate-dfa-benchmark.py @@ -85,6 +85,7 @@ Perform timing measurements of BME680 funtion calls: import getopt import json +import logging import os import re import sys @@ -434,6 +435,7 @@ if __name__ == "__main__": "dummy= " "energytrace= " "instance= " + "log-level= " "mimosa= " "repeat= " "run= " @@ -475,6 +477,13 @@ if __name__ == "__main__": else: opt["trace-filter"] = None + 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: {args.log_level}", file=sys.stderr) + sys.exit(1) + logging.basicConfig(level=numeric_level) + if "mimosa" in opt: if opt["mimosa"] == "": opt["mimosa"] = dict() |