From 9df23d1de5470d23ad3c3b07a0558eb157bb5c3d Mon Sep 17 00:00:00 2001 From: Matthew Evans Date: Sun, 22 Oct 2023 14:40:32 +0100 Subject: [PATCH] Make log folder if missing, and add clarifying note --- src/jobflow_remote/utils/log.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/jobflow_remote/utils/log.py b/src/jobflow_remote/utils/log.py index 81cd93f8..237e2c8d 100644 --- a/src/jobflow_remote/utils/log.py +++ b/src/jobflow_remote/utils/log.py @@ -6,6 +6,8 @@ import logging.config from pathlib import Path +from monty.os import makedirs_p + def initialize_runner_logger(log_folder: str | Path, level: int = logging.INFO): """Initialize the default logger. @@ -25,7 +27,10 @@ def initialize_runner_logger(log_folder: str | Path, level: int = logging.INFO): # TODO if the directory it is not present it does not initialize the logger with # an unclear error message. It may be worth leaving this: - # makedirs_p(log_folder) + + # @ml-evs: Indeed I found this necessary when testing the runner locally -- cryptic crashes + # if the log folder is not present, so I have retained it here. + makedirs_p(log_folder) config = { "version": 1,