Selaa lähdekoodia

Adaption to new logging

master
Dirk Alders 3 vuotta sitten
vanhempi
commit
be03b653eb
2 muutettua tiedostoa jossa 10 lisäystä ja 2 poistoa
  1. 5
    1
      access.py
  2. 5
    1
      search.py

+ 5
- 1
access.py Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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…
Peruuta
Tallenna