From 1e1860da24b2a919946e32e321c4f6582f3c6d4c Mon Sep 17 00:00:00 2001 From: Arthur Zwiegincew Date: Wed, 4 Oct 2023 09:02:45 -0700 Subject: [PATCH] Fix stdout logging (#1073) When the log folder is not specified, the test runner currently fails saying that None can't be added to a string for obvious reasons. --- tests/perf/long_runner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/perf/long_runner.py b/tests/perf/long_runner.py index ff0b4542587..52be57d9fc1 100644 --- a/tests/perf/long_runner.py +++ b/tests/perf/long_runner.py @@ -133,11 +133,11 @@ def gather_cpu_memory(): ) args = parser.parse_args() log_folder = args.log_folder - output_file_path = f"{log_folder if log_folder and log_folder[-1] == '/' else log_folder + '/'}long_running_{datetime.datetime.now().strftime('%Y%m%d-%H%M%S')}.log" logger = logging.getLogger("long-running") logger.setLevel(logging.INFO) if log_folder: - logger.addHandler(logging.FileHandler(output_file_path)) + log_file_path = f"{log_folder if log_folder[-1] == '/' else log_folder + '/'}long_running_{datetime.datetime.now().strftime('%Y%m%d-%H%M%S')}.log" + logger.addHandler(logging.FileHandler(log_file_path)) else: logger.addHandler(logging.StreamHandler(sys.stdout)) log_header = {