From 721e82a06eae7b1468e46ae9346f040523e9bb75 Mon Sep 17 00:00:00 2001 From: wt Date: Mon, 25 Oct 2021 19:27:21 +0800 Subject: [PATCH] [skip ci] Update code for log on benchmark (#10566) Signed-off-by: wangting0128 --- tests/benchmark/milvus_benchmark/logs/log.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/benchmark/milvus_benchmark/logs/log.py b/tests/benchmark/milvus_benchmark/logs/log.py index df84461c70..865e9a812a 100644 --- a/tests/benchmark/milvus_benchmark/logs/log.py +++ b/tests/benchmark/milvus_benchmark/logs/log.py @@ -13,11 +13,18 @@ def setup_logging(config_path=LOG_CONFIG_PATH, default_level=logging.INFO): """ Setup logging configuration """ - print(FILE_NAME) + print(global_params.log_file_path) try: with open(config_path, 'rt') as f: log_config = yaml.safe_load(f.read()) - log_config["handlers"]["info_file_handler"].update({"filename": FILE_NAME}) + log_config["handlers"]["info_file_handler"].update({"filename": global_params.log_file_path}) logging.config.dictConfig(log_config) except Exception: raise logging.error('Failed to open file', exc_info=True) + + +class GlobalParams: + log_file_path = FILE_NAME + + +global_params = GlobalParams()