1
0
Fork 0

make sure log is initialized before usage

This commit is contained in:
JoshuaMKW 2020-11-06 04:24:30 -06:00
parent c78fc457ec
commit 50cceb6245

View file

@ -310,6 +310,9 @@ class GUI(object):
self.log = logging.getLogger(f"GeckoLoader {self.cli.__version__}") 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")) hdlr = logging.FileHandler(os.path.join(get_program_folder("GeckoLoader"), "error.log"))
formatter = logging.Formatter("\n%(levelname)s (%(asctime)s): %(message)s") formatter = logging.Formatter("\n%(levelname)s (%(asctime)s): %(message)s")
hdlr.setFormatter(formatter) hdlr.setFormatter(formatter)