make sure log is initialized before usage
This commit is contained in:
parent
c78fc457ec
commit
50cceb6245
1 changed files with 3 additions and 0 deletions
|
@ -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)
|
||||||
|
|
Reference in a new issue