From 89a6787c37c84c8554034681776c77c0313edbee Mon Sep 17 00:00:00 2001 From: lb584 <lb584@cam.ac.uk> Date: Mon, 13 May 2024 16:02:49 +0100 Subject: [PATCH] fixing default file paths --- coordinator/utils/processor_utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/coordinator/utils/processor_utils.py b/coordinator/utils/processor_utils.py index fc99696..acdaadb 100644 --- a/coordinator/utils/processor_utils.py +++ b/coordinator/utils/processor_utils.py @@ -356,7 +356,8 @@ def setup_logging(job_file_path: str, is_live: bool, log_level: str): # if there is no value set for the LOGGING_CONFIG file, set a default path. if not 'LOGGING_CONFIG' in os.environ: - log_config_path_project = os.path.join(os.path.dirname(__file__), "..", "/configs", "logger", "template_log_config.json") + import coordinator + log_config_path_project = os.path.join(os.path.dirname(coordinator.__file__), "..", "configs", "logger", "template_log_config.json") print(f"ENVIRONMENT VARIABLE 'LOGGING_CONFIG' IS NOT SET, UISING DEFAULT FILE - {log_config_path_project}") else: log_config_path_project = os.environ['LOGGING_CONFIG'] @@ -378,7 +379,7 @@ def setup_logging(job_file_path: str, is_live: bool, log_level: str): # if there is no value set for the central project logger in the json file, set a default path. if not log_config_dict['handlers']['handler_project']['filename']: # todo how does this work when there are several processors running at once, i.o. errors? - log_path_project = os.path.join(os.path.dirname(__file__), "..", "configs", "logger", "log.txt") + log_path_project = os.path.join(Path.home(), "ews_project_log.txt") print(f"'HANDLER_PROJECT' HAS NO 'FILENAME' SET TO SETTING TO {log_path_project}") log_config_dict['handlers']['handler_project']['filename'] = log_path_project -- GitLab