瀏覽代碼

Logger creation simplified

make_mycreole_indenpendent_from_patt
Dirk Alders 3 週之前
父節點
當前提交
997594e371
共有 2 個檔案被更改,包括 2 行新增10 行删除
  1. 1
    5
      context.py
  2. 1
    5
      views.py

+ 1
- 5
context.py 查看文件

@@ -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 查看文件

@@ -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):

Loading…
取消
儲存