Browse Source

Adaption to new logging

master
Dirk Alders 3 years ago
parent
commit
be03b653eb
2 changed files with 10 additions and 2 deletions
  1. 5
    1
      access.py
  2. 5
    1
      search.py

+ 5
- 1
access.py View File

2
 from .models import Task, Project, Comment, TASKSTATE_CHOICES, TASKS_IN_WORK, PROJECTS_IN_WORK, PRIO_CHOICES
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
 def read_attachment(request, rel_path):
12
 def read_attachment(request, rel_path):

+ 5
- 1
search.py View File

9
 from whoosh.qparser.dateparse import DateParserPlugin
9
 from whoosh.qparser.dateparse import DateParserPlugin
10
 from whoosh import index, qparser
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
 SEARCH_MY_OPEN_TASKS = 1
18
 SEARCH_MY_OPEN_TASKS = 1
15
 SEARCH_LOST_SOULS = 2
19
 SEARCH_LOST_SOULS = 2

Loading…
Cancel
Save