Kaynağa Gözat

Adaption to new logging

master
Dirk Alders 3 yıl önce
ebeveyn
işleme
114a82e176
4 değiştirilmiş dosya ile 20 ekleme ve 4 silme
  1. 5
    1
      models.py
  2. 5
    1
      search.py
  3. 5
    1
      signals.py
  4. 5
    1
      views/xnail.py

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

@@ -26,7 +26,11 @@ EXTENTIONS_VIDEO = ['.avi', '.mpg', '.mpeg', '.mpe', '.mov', '.qt', '.mp4', '.we
26 26
 
27 27
 
28 28
 # Get a logger instance
29
-logger = logging.getLogger("CACHING")
29
+try:
30
+    from config import APP_NAME as ROOT_LOGGER_NAME
31
+except ImportError:
32
+    ROOT_LOGGER_NAME = 'root'
33
+logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__)
30 34
 
31 35
 
32 36
 def get_item_type(full_path):

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

@@ -8,7 +8,11 @@ from whoosh.qparser.dateparse import DateParserPlugin
8 8
 from whoosh import index, qparser
9 9
 from pygal.models import TYPE_FOLDER
10 10
 
11
-logger = logging.getLogger("WHOOSH")
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__)
12 16
 
13 17
 
14 18
 SCHEMA = Schema(

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

@@ -8,7 +8,11 @@ import shutil
8 8
 from .views.xnail import base_item
9 9
 
10 10
 # Get a logger instance
11
-clogger = logging.getLogger("CACHING")
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__)
12 16
 
13 17
 __pre_remove__ = None
14 18
 __pre_add__ = None

+ 5
- 1
views/xnail.py Dosyayı Görüntüle

@@ -8,7 +8,11 @@ import os
8 8
 import pygal
9 9
 
10 10
 # Get a logger instance
11
-logger = logging.getLogger("CACHING")
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__)
12 16
 
13 17
 
14 18
 def get_image_class(full_path):

Loading…
İptal
Kaydet