Fixed logging
This commit is contained in:
parent
448ef61501
commit
00217b7a8e
|
@ -5,8 +5,8 @@ import os, logging
|
|||
|
||||
|
||||
class Logger:
|
||||
def __init__(self):
|
||||
pass
|
||||
def __init__(config_path):
|
||||
self._CONFIG_PATH = config_path
|
||||
|
||||
def get_logger(self, loggerName = "NO_LOGGER_NAME_PASSED", createFile = True):
|
||||
"""
|
||||
|
@ -42,8 +42,8 @@ class Logger:
|
|||
log.addHandler(ch)
|
||||
|
||||
if createFile:
|
||||
folder = "logs"
|
||||
file = folder + "/application.log"
|
||||
folder = self._CONFIG_PATH
|
||||
file = f"{folder}/application.log"
|
||||
|
||||
if not os.path.exists(folder):
|
||||
os.mkdir(folder)
|
||||
|
|
|
@ -26,7 +26,7 @@ class Settings:
|
|||
self._WINDOW_ICON = f"{self._DEFAULT_ICONS}/{app_name.lower()}.png"
|
||||
self._USR_PATH = f"/usr/share/{app_name.lower()}"
|
||||
|
||||
self._logger = Logger().get_logger()
|
||||
self._logger = Logger(self._CONFIG_PATH).get_logger()
|
||||
self._builder = Gtk.Builder()
|
||||
self._main_window = None
|
||||
|
||||
|
@ -42,6 +42,10 @@ class Settings:
|
|||
self._warning_color = "#ffa800"
|
||||
self._error_color = "#ff0000"
|
||||
|
||||
if not os.path.exists(self._GLADE_FILE):
|
||||
os.mkdir(self._CONFIG_PATH)
|
||||
self._logger = Logger(self._CONFIG_PATH).get_logger()
|
||||
|
||||
if not os.path.exists(self._GLADE_FILE):
|
||||
self._GLADE_FILE = f"{self._USR_PATH}/Main_Window.glade"
|
||||
if not os.path.exists(self._CSS_FILE):
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 6.4 KiB |
Loading…
Reference in New Issue