mirror of https://github.com/milvus-io/milvus.git
[skip ci] Update code for log on benchmark (#10566)
Signed-off-by: wangting0128 <ting.wang@zilliz.com>pull/10597/head
parent
de1cbccb2a
commit
721e82a06e
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue