From 1ab3a280617bd6dd7338f1cbd0b18eb2e3bdb854 Mon Sep 17 00:00:00 2001 From: BrandonPacewic <92102436+BrandonPacewic@users.noreply.github.com> Date: Mon, 19 Aug 2024 15:00:51 -0700 Subject: [PATCH] Refactor `setupLogger()` Co-authored-by: Azalea --- exporter/SynthesisFusionAddin/src/Logging.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/exporter/SynthesisFusionAddin/src/Logging.py b/exporter/SynthesisFusionAddin/src/Logging.py index 6379a9212..90f1d98d3 100644 --- a/exporter/SynthesisFusionAddin/src/Logging.py +++ b/exporter/SynthesisFusionAddin/src/Logging.py @@ -30,12 +30,10 @@ def cleanupHandlers(self) -> None: def setupLogger() -> SynthesisLogger: now = datetime.now().strftime("%H-%M-%S") today = date.today() - if not IS_RELEASE: - logFileFolder = makeDirectories(os.path.join(f"{pathlib.Path(__file__).parent.parent}", "logs")) - else: + if IS_RELEASE: logFileFolder = makeDirectories(os.path.join(SUPPORT_PATH, "Logs")) - - if not IS_RELEASE: + else: + logFileFolder = makeDirectories(os.path.join(f"{pathlib.Path(__file__).parent.parent}", "logs")) logFiles = [os.path.join(logFileFolder, file) for file in os.listdir(logFileFolder) if file.endswith(".log")] logFiles.sort() if len(logFiles) >= MAX_LOG_FILES_TO_KEEP: