mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 11:21:52 +08:00
[skip ci] Update code for log on benchmark (#10566)
Signed-off-by: wangting0128 <ting.wang@zilliz.com>
This commit is contained in:
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…
x
Reference in New Issue
Block a user