From 6e82add9351b999024c1c2f544aa9c1a4b7cece8 Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 29 Nov 2017 07:07:03 +0100 Subject: [PATCH] Rename debug.log to django-debug.log and refactor MODULES_TO_LOG_LEVEL --- dynamicweb/settings/base.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dynamicweb/settings/base.py b/dynamicweb/settings/base.py index 265e97a0..10cdf40c 100644 --- a/dynamicweb/settings/base.py +++ b/dynamicweb/settings/base.py @@ -586,16 +586,16 @@ handlers_dict = { 'file': { 'level': 'DEBUG', 'class': 'logging.FileHandler', - 'filename': "{PROJECT_DIR}/debug.log".format( + 'filename': "{PROJECT_DIR}/django-debug.log".format( PROJECT_DIR=PROJECT_DIR), }, } MODULES_TO_LOG = env('MODULES_TO_LOG') -MODULES_TO_LOG_LEVEL = env('MODULES_TO_LOG_LEVEL') +LOG_LEVEL = env('LOG_LEVEL') -if MODULES_TO_LOG_LEVEL is None: - MODULES_TO_LOG_LEVEL = 'DEBUG' +if LOG_LEVEL is None: + LOG_LEVEL = 'DEBUG' if MODULES_TO_LOG: if ',' in MODULES_TO_LOG: @@ -604,7 +604,7 @@ if MODULES_TO_LOG: logger_item = { custom_module: { 'handlers': ['custom_file'], - 'level': MODULES_TO_LOG_LEVEL, + 'level': LOG_LEVEL, 'propagate': True } } @@ -613,7 +613,7 @@ if MODULES_TO_LOG: logger_item = { MODULES_TO_LOG: { 'handlers': ['custom_file'], - 'level': MODULES_TO_LOG_LEVEL, + 'level': LOG_LEVEL, 'propagate': True } } @@ -621,11 +621,11 @@ if MODULES_TO_LOG: custom_handler_item = { 'custom_file': { - 'level': MODULES_TO_LOG_LEVEL, + 'level': LOG_LEVEL, 'class': 'logging.FileHandler', 'filename': "{PROJECT_DIR}/custom_{LEVEL}.log".format( - LEVEL=MODULES_TO_LOG_LEVEL.lower(), + LEVEL=LOG_LEVEL.lower(), PROJECT_DIR=PROJECT_DIR ) }