Browse Source

Adaption to new logging

master
Dirk Alders 4 years ago
parent
commit
37c050bdbf
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      __init__.py

+ 5
- 2
__init__.py View 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…
Cancel
Save