From 6022f0f945e4d2dd9905482ada032b185c99e7cb Mon Sep 17 00:00:00 2001 From: Friedel Wolff Date: Thu, 1 Aug 2024 11:55:24 +0200 Subject: [PATCH] Rename LOGGING_FOLDER_DEFAULT -> LOGGING_DIR --- app/app/settings.py | 6 ++---- app/general/tests/test_logging.py | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/app/app/settings.py b/app/app/settings.py index 98dda2f8..46773ce6 100644 --- a/app/app/settings.py +++ b/app/app/settings.py @@ -234,7 +234,7 @@ def __contains__(self, address): DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" -LOGGING_FOLDER_DEFAULT = os.path.abspath(os.path.join("/logging/")) +LOGGING_DIR = Path("/logging") # Internationalization @@ -281,9 +281,7 @@ def __contains__(self, address): "file": { "level": os.environ.get("LOGGING_HANDLERS_LEVEL", "WARNING"), "class": "logging.FileHandler", - "filename": os.path.join( - LOGGING_FOLDER_DEFAULT, os.environ.get("LOGGING_FILE", "debug.log") - ), + "filename": LOGGING_DIR / os.environ.get("LOGGING_FILE", "debug.log"), "formatter": "verbose", }, }, diff --git a/app/general/tests/test_logging.py b/app/general/tests/test_logging.py index 00926204..b24d6ccb 100644 --- a/app/general/tests/test_logging.py +++ b/app/general/tests/test_logging.py @@ -1,15 +1,14 @@ import logging import os -import sys from django.test import TestCase class LoggingTest(TestCase): def setUp(self): - LOGGING_FOLDER_DEFAULT = os.path.abspath(os.path.join("/logging/")) + LOGGING_DIR = "/logging" self.logger = logging.getLogger("django") - self.log_file = os.path.join(LOGGING_FOLDER_DEFAULT, "debug.log") + self.log_file = os.path.join(LOGGING_DIR, "debug.log") def test_log_file_created(self): """Test if the log file is created."""