From 533cde22c02fe31145d857c76889b999bdd70d06 Mon Sep 17 00:00:00 2001 From: Yanray Wang Date: Wed, 26 Jul 2023 10:17:17 +0800 Subject: [PATCH] code_size_compare: set log level as ERROR in option --stdout If we use option --stdout, the logging level is set as logging.ERROR. But --verbose is able to overwrite logging level as logging.INFO if we want to display intermediate log in the process of code size comparison. Signed-off-by: Yanray Wang --- scripts/code_size_compare.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/code_size_compare.py b/scripts/code_size_compare.py index 53d4e3b6d9..2bb8b0e2a6 100755 --- a/scripts/code_size_compare.py +++ b/scripts/code_size_compare.py @@ -856,7 +856,10 @@ def main(): logger = logging.getLogger() logging_util.configure_logger(logger) - logger.setLevel(logging.DEBUG if comp_args.verbose else logging.INFO) + if comp_args.stdout and not comp_args.verbose: + logger.setLevel(logging.ERROR) + else: + logger.setLevel(logging.DEBUG if comp_args.verbose else logging.INFO) if os.path.isfile(comp_args.comp_dir): logger.error("{} is not a directory".format(comp_args.comp_dir))