Ver código fonte

Adaption to new logging

master
Dirk Alders 4 anos atrás
pai
commit
37c050bdbf
1 arquivos alterados com 5 adições e 2 exclusões
  1. 5
    2
      __init__.py

+ 5
- 2
__init__.py Ver arquivo

@@ -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):

Carregando…
Cancelar
Salvar