summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2022-02-18 15:47:08 +0100
committerDaniel Friesel <daniel.friesel@uos.de>2022-02-18 15:47:08 +0100
commitafbb5e789a3a25ee875333785149559af5e89970 (patch)
tree85f3b7b73ff6cf947d6de3e75add64429eea4afd /bin
parente1033f50fd5eabf20d2d0e0abef672d9c67e8b59 (diff)
move --log-level and --info to cli.py
Diffstat (limited to 'bin')
-rwxr-xr-xbin/analyze-archive.py12
-rwxr-xr-xbin/analyze-kconfig.py19
2 files changed, 6 insertions, 25 deletions
diff --git a/bin/analyze-archive.py b/bin/analyze-archive.py
index 88b6802..fef8005 100755
--- a/bin/analyze-archive.py
+++ b/bin/analyze-archive.py
@@ -365,11 +365,6 @@ if __name__ == "__main__":
)
dfatool.cli.add_standard_arguments(parser)
parser.add_argument(
- "--info",
- action="store_true",
- help="Show state duration and (for each state and transition) number of measurements and parameter values)",
- )
- parser.add_argument(
"--no-cache", action="store_true", help="Do not load cached measurement results"
)
parser.add_argument(
@@ -459,13 +454,6 @@ if __name__ == "__main__":
"Note that this may remove entire function calls from the model.",
)
parser.add_argument(
- "--log-level",
- metavar="LEVEL",
- choices=["debug", "info", "warning", "error"],
- default="warning",
- help="Set log level",
- )
- parser.add_argument(
"--with-safe-functions",
action="store_true",
help="Include 'safe' functions (safe_log, safe_inv, safe_sqrt) which are also defined for 0 and -1. "
diff --git a/bin/analyze-kconfig.py b/bin/analyze-kconfig.py
index b9f071f..a2deaf7 100755
--- a/bin/analyze-kconfig.py
+++ b/bin/analyze-kconfig.py
@@ -73,15 +73,6 @@ def main():
metavar="FILE",
)
parser.add_argument(
- "--log-level",
- default=logging.INFO,
- type=lambda level: getattr(logging, level.upper()),
- help="Set log level",
- )
- parser.add_argument(
- "--info", action="store_true", help="Show Kconfig and benchmark information"
- )
- parser.add_argument(
"--sample-size",
type=int,
help="Restrict model generation to N random samples",
@@ -118,10 +109,12 @@ def main():
args = parser.parse_args()
- if isinstance(args.log_level, int):
- logging.basicConfig(level=args.log_level)
- else:
- print(f"Invalid log level. Setting log level to INFO.", file=sys.stderr)
+ if args.log_level:
+ numeric_level = getattr(logging, args.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 args.export_dref:
dref = dict()