Refactor logging setup across multiple modules to use loguru with consistent configuration

- Updated logging initialization in MessageCalendar, admin_edit_prof, elsa_main, graph, iconLine, searchPage, and richtext modules to use loguru.
- Changed log rotation and retention settings for log files to improve log management.
- Replaced logger.debug/info calls with log.debug/info for consistency.
- Fixed a typo in the searchPage UI and updated related references in the UI files.
- Removed unused imports and cleaned up code for better readability.
This commit is contained in:
2025-05-13 15:49:52 +02:00
parent 4a3a95623a
commit f7c499ea6e
32 changed files with 412 additions and 491 deletions

View File

@@ -6,7 +6,7 @@ from loguru import logger as log
logger = log
logger.remove()
logger.add("logs/application.log", rotation="1 week", enqueue=True)
logger.add("logs/application.log", rotation="1 week", retention="1 month", enqueue=True)
# logger.add(sys.stderr, format="{time} {level} {message}", level="INFO")
@@ -29,9 +29,12 @@ class IconWidget(QtWidgets.QWidget, Ui_Dialog):
self.icon_filename_line.setText(
file_dialog.selectedFiles()[0].split("/")[-1]
)
logger.debug(
"Icon changed to: {}", file_dialog.selectedFiles()[0].split("/")[-1]
)
try:
log.debug(
"Icon changed to: {}", file_dialog.selectedFiles()[0].split("/")[-1]
)
except IndexError:
log.debug("No file selected")
def return_data(self):
return self.icon_name_settings.text(), self.icon_filename_line.text()