From 997594e37149b55e598f7dedfefed3c2998a2c87 Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Tue, 8 Oct 2024 22:30:16 +0200 Subject: [PATCH] Logger creation simplified --- context.py | 6 +----- views.py | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/context.py b/context.py index 0c8622c..d6d1c4f 100644 --- a/context.py +++ b/context.py @@ -8,11 +8,7 @@ from mycreole import url_upload from mycreole import parameter from themes import color_icon_url -try: - from config import APP_NAME as ROOT_LOGGER_NAME -except ImportError: - ROOT_LOGGER_NAME = 'root' -logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__) +logger = logging.getLogger(settings.ROOT_LOGGER_NAME).getChild(__name__) NEW_ATTACHMENT_UID = 'new_attachment' diff --git a/views.py b/views.py index 0f10866..7419913 100644 --- a/views.py +++ b/views.py @@ -14,11 +14,7 @@ import stringtools import themes from django.contrib import messages -try: - from config import APP_NAME as ROOT_LOGGER_NAME -except ImportError: - ROOT_LOGGER_NAME = 'root' -logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__) +logger = logging.getLogger(settings.ROOT_LOGGER_NAME).getChild(__name__) def get_next(request):