Bläddra i källkod

Logger creation simplified

make_mycreole_indenpendent_from_patt
Dirk Alders 2 månader sedan
förälder
incheckning
997594e371
2 ändrade filer med 2 tillägg och 10 borttagningar
  1. 1
    5
      context.py
  2. 1
    5
      views.py

+ 1
- 5
context.py Visa fil

@@ -8,11 +8,7 @@ from mycreole import url_upload
8 8
 from mycreole import parameter
9 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 13
 NEW_ATTACHMENT_UID = 'new_attachment'
18 14
 

+ 1
- 5
views.py Visa fil

@@ -14,11 +14,7 @@ import stringtools
14 14
 import themes
15 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 20
 def get_next(request):

Laddar…
Avbryt
Spara