Skip to content

Commit

Permalink
Rename LOGGING_FOLDER_DEFAULT -> LOGGING_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
friedelwolff committed Aug 1, 2024
1 parent eb28bfe commit 6022f0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 2 additions & 4 deletions app/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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",
},
},
Expand Down
5 changes: 2 additions & 3 deletions app/general/tests/test_logging.py
Original file line number Diff line number Diff line change
@@ -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."""
Expand Down

0 comments on commit 6022f0f

Please sign in to comment.