additional logging and error handling

This commit is contained in:
2026-05-29 10:44:50 +02:00
parent 72a0e52e08
commit 9ddc1f5b99
3 changed files with 72 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
import logging
from dopt_basics.logging import BASE_LOGGER, setup_logging
from dopt_basics.logging import BASE_LOGGER, LoggingConfig, setup_logging
from wce_crm.constants import Config
@@ -14,12 +14,16 @@ if Config.DEVELOPMENT_STATE:
if not Config.PATH_LOGGING.exists():
Config.PATH_LOGGING.mkdir()
setup_logging(
LOGGING_CFG: LoggingConfig = LoggingConfig(
enable_stderr=enable_stderr,
enable_file=enable_file,
logging_dir=Config.PATH_LOGGING,
log_filename=Config.LOG_FILENAME,
file_max_bytes=10_485_760,
file_backup_count=2,
)
setup_logging(LOGGING_CFG)
logger_base = BASE_LOGGER.getChild("wce_crm")
# ** GUI
@@ -31,3 +35,7 @@ logger_get_data = logger_gui.getChild("get_data")
logger_get_data.setLevel(logging.DEBUG)
logger_auto_form = logger_gui.getChild("get_data_auto_form")
logger_auto_form.setLevel(logging.DEBUG)
# ** Backend
logger_back = logger_base.getChild("backend")
logger_back.setLevel(logging.DEBUG)