Kaynağa Gözat

Adaption to new logging

master
Dirk Alders 3 yıl önce
ebeveyn
işleme
be03b653eb
2 değiştirilmiş dosya ile 10 ekleme ve 2 silme
  1. 5
    1
      access.py
  2. 5
    1
      search.py

+ 5
- 1
access.py Dosyayı Görüntüle

@@ -2,7 +2,11 @@ import logging
2 2
 from .models import Task, Project, Comment, TASKSTATE_CHOICES, TASKS_IN_WORK, PROJECTS_IN_WORK, PRIO_CHOICES
3 3
 
4 4
 
5
-logger = logging.getLogger('ACC')
5
+try:
6
+    from config import APP_NAME as ROOT_LOGGER_NAME
7
+except ImportError:
8
+    ROOT_LOGGER_NAME = 'root'
9
+logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__)
6 10
 
7 11
 
8 12
 def read_attachment(request, rel_path):

+ 5
- 1
search.py Dosyayı Görüntüle

@@ -9,7 +9,11 @@ from whoosh.fields import Schema, ID, TEXT, NUMERIC, DATETIME, BOOLEAN
9 9
 from whoosh.qparser.dateparse import DateParserPlugin
10 10
 from whoosh import index, qparser
11 11
 
12
-logger = logging.getLogger("WHOOSH")
12
+try:
13
+    from config import APP_NAME as ROOT_LOGGER_NAME
14
+except ImportError:
15
+    ROOT_LOGGER_NAME = 'root'
16
+logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__)
13 17
 
14 18
 SEARCH_MY_OPEN_TASKS = 1
15 19
 SEARCH_LOST_SOULS = 2

Loading…
İptal
Kaydet