Sfoglia il codice sorgente

Adaption to new logging

master
Dirk Alders 4 anni fa
parent
commit
37c050bdbf
1 ha cambiato i file con 5 aggiunte e 2 eliminazioni
  1. 5
    2
      __init__.py

+ 5
- 2
__init__.py Vedi File

@@ -31,8 +31,11 @@ import logging
31 31
 import serial
32 32
 import time
33 33
 
34
-logger_name = 'SERIAL_INTERFACE'
35
-logger = logging.getLogger(logger_name)
34
+try:
35
+    from config import APP_NAME as ROOT_LOGGER_NAME
36
+except ImportError:
37
+    ROOT_LOGGER_NAME = 'root'
38
+logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__)
36 39
 
37 40
 
38 41
 class serial_interface(object):

Loading…
Annulla
Salva