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

+ 6
- 1
main/settings.py View File

17
 import sys
17
 import sys
18
 import random
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
 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
26
 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
22
 #
27
 #
238
             'level': 'INFO',
243
             'level': 'INFO',
239
             'propagate': False,
244
             'propagate': False,
240
         },
245
         },
241
-        config.APP_NAME: {
246
+        ROOT_LOGGER_NAME: {
242
             'handlers': default_handler,
247
             'handlers': default_handler,
243
             'level': 'DEBUG' if DEBUG else 'INFO',
248
             'level': 'DEBUG' if DEBUG else 'INFO',
244
             'propagate': False,
249
             'propagate': False,

Loading…
Cancel
Save