Browse Source

Logger creation simplified

make_mycreole_indenpendent_from_patt
Dirk Alders 2 months ago
parent
commit
997594e371
2 changed files with 2 additions and 10 deletions
  1. 1
    5
      context.py
  2. 1
    5
      views.py

+ 1
- 5
context.py View File

8
 from mycreole import parameter
8
 from mycreole import parameter
9
 from themes import color_icon_url
9
 from themes import color_icon_url
10
 
10
 
11
-try:
12
-    from config import APP_NAME as ROOT_LOGGER_NAME
13
-except ImportError:
14
-    ROOT_LOGGER_NAME = 'root'
15
-logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__)
11
+logger = logging.getLogger(settings.ROOT_LOGGER_NAME).getChild(__name__)
16
 
12
 
17
 NEW_ATTACHMENT_UID = 'new_attachment'
13
 NEW_ATTACHMENT_UID = 'new_attachment'
18
 
14
 

+ 1
- 5
views.py View File

14
 import themes
14
 import themes
15
 from django.contrib import messages
15
 from django.contrib import messages
16
 
16
 
17
-try:
18
-    from config import APP_NAME as ROOT_LOGGER_NAME
19
-except ImportError:
20
-    ROOT_LOGGER_NAME = 'root'
21
-logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__)
17
+logger = logging.getLogger(settings.ROOT_LOGGER_NAME).getChild(__name__)
22
 
18
 
23
 
19
 
24
 def get_next(request):
20
 def get_next(request):

Loading…
Cancel
Save