From 50cceb624531583757a72be2e1213ae11cf4aaec Mon Sep 17 00:00:00 2001 From: JoshuaMKW Date: Fri, 6 Nov 2020 04:24:30 -0600 Subject: [PATCH] make sure log is initialized before usage --- GeckoLoader.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/GeckoLoader.py b/GeckoLoader.py index 81fc9c3..cf3e0e4 100644 --- a/GeckoLoader.py +++ b/GeckoLoader.py @@ -310,6 +310,9 @@ class GUI(object): self.log = logging.getLogger(f"GeckoLoader {self.cli.__version__}") + if not os.path.exists(get_program_folder("GeckoLoader")): + os.mkdir(get_program_folder("GeckoLoader")) + hdlr = logging.FileHandler(os.path.join(get_program_folder("GeckoLoader"), "error.log")) formatter = logging.Formatter("\n%(levelname)s (%(asctime)s): %(message)s") hdlr.setFormatter(formatter)