Browse Source

Some more Adaption to new logging (as in pygal)

master
Dirk Alders 3 years ago
parent
commit
6397ca4139
2 changed files with 9 additions and 1 deletions
  1. 3
    0
      config_example/config.py
  2. 6
    1
      main/settings.py

+ 3
- 0
config_example/config.py View File

@@ -2,6 +2,9 @@
2 2
 # General settings
3 3
 #
4 4
 
5
+# APP_NAME is used for logging
6
+APP_NAME = 'patt'
7
+
5 8
 # SECURITY WARNING: don't run with debug turned on in production!
6 9
 # DEBUG = False
7 10
 

+ 6
- 1
main/settings.py View File

@@ -17,6 +17,11 @@ import stat
17 17
 import sys
18 18
 import random
19 19
 
20
+try:
21
+    from config import APP_NAME as ROOT_LOGGER_NAME
22
+except ImportError:
23
+    ROOT_LOGGER_NAME = 'root'
24
+
20 25
 
21 26
 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
22 27
 #
@@ -238,7 +243,7 @@ File "%(pathname)s", line %(lineno)d, in %(funcName)s
238 243
             'level': 'INFO',
239 244
             'propagate': False,
240 245
         },
241
-        config.APP_NAME: {
246
+        ROOT_LOGGER_NAME: {
242 247
             'handlers': default_handler,
243 248
             'level': 'DEBUG' if DEBUG else 'INFO',
244 249
             'propagate': False,

Loading…
Cancel
Save