From b0ff5083061412098fd4699f3f1f1664f0555aa3 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Wed, 23 Feb 2022 13:41:54 -0500 Subject: [PATCH] [82] fix logging error --- VERSION | 2 +- modules/logs.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index c5ce6b5d..7e4e11bc 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.15.1-develop81 +1.15.1-develop82 diff --git a/modules/logs.py b/modules/logs.py index b386a4ea..acd5608e 100644 --- a/modules/logs.py +++ b/modules/logs.py @@ -77,8 +77,7 @@ class MyLogger: self._logger.removeHandler(self.main_handler) def add_library_handler(self, library_key): - if not self.library_handlers: - os.makedirs(os.path.join(self.log_dir, library_key, COLLECTION_DIR), exist_ok=True) + os.makedirs(os.path.join(self.log_dir, library_key, COLLECTION_DIR), exist_ok=True) self.library_handlers[library_key] = self._get_handler(os.path.join(self.log_dir, library_key, LIBRARY_LOG)) self._logger.addHandler(self.library_handlers[library_key]) @@ -100,8 +99,8 @@ class MyLogger: def add_collection_handler(self, library_key, collection_key): collection_dir = os.path.join(self.log_dir, library_key, COLLECTION_DIR, collection_key) + os.makedirs(collection_dir, exist_ok=True) if library_key not in self.collection_handlers: - os.makedirs(collection_dir, exist_ok=True) self.collection_handlers[library_key] = {} self.collection_handlers[library_key][collection_key] = self._get_handler(os.path.join(collection_dir, COLLECTION_LOG)) self._logger.addHandler(self.collection_handlers[library_key][collection_key])