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:
@@ -3,15 +3,14 @@ from PyQt6 import QtWidgets
|
||||
|
||||
from src.logic import Prof
|
||||
from src.backend import Database
|
||||
import loguru
|
||||
import sys
|
||||
from loguru import logger as log
|
||||
|
||||
logger = log
|
||||
logger.remove()
|
||||
logger.add("logs/application.log", rotation="1 week", retention="1 month", enqueue=True)
|
||||
log = loguru.logger
|
||||
log.remove()
|
||||
log.add(sys.stdout)
|
||||
log.add("logs/application.log", rotation="1 MB", retention="10 days")
|
||||
|
||||
# logger.add(sys.stderr, format="{time} {level} {message}", level="INFO")
|
||||
logger.add(sys.stdout)
|
||||
|
||||
|
||||
class EditProf(QtWidgets.QDialog, Ui_Dialog):
|
||||
@@ -69,7 +68,7 @@ class EditProf(QtWidgets.QDialog, Ui_Dialog):
|
||||
else:
|
||||
self.faculty_member_old_telnr.setText(data.telnr)
|
||||
self.faculty_member_oldmail.setText(data.mail)
|
||||
logger.debug(data)
|
||||
log.debug(data)
|
||||
(
|
||||
self.edit_faculty_member_title.setText(data.title)
|
||||
if data.title is not None
|
||||
@@ -93,7 +92,7 @@ class EditProf(QtWidgets.QDialog, Ui_Dialog):
|
||||
olddata = self.db.getProfByName(
|
||||
self.edit_faculty_member_select_member.currentText()
|
||||
)
|
||||
logger.debug(olddata)
|
||||
log.debug(olddata)
|
||||
data = olddata
|
||||
oldlname = data.lastname
|
||||
oldfname = data.firstname
|
||||
|
||||
Reference in New Issue
Block a user