diff --git a/mloggers/file_logger.py b/mloggers/file_logger.py index a89ba6e..5354fe4 100644 --- a/mloggers/file_logger.py +++ b/mloggers/file_logger.py @@ -25,6 +25,8 @@ def __init__(self, file_path: str): # Create the file if it does not exist if not os.path.exists(file_path): + dir_path = os.path.dirname(file_path) + os.makedirs(dir_path) with open(file_path, "w") as file: file.write("") diff --git a/pyproject.toml b/pyproject.toml index 9ef34bd..fab86ec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "mloggers" -version = "1.1.4" +version = "1.1.5" authors = [ { name = "Sergio Hernandez Gutierrez", email = "contact.sergiohernandez@gmail.com" }, ]