瀏覽代碼

Adaption to new logging

master
Dirk Alders 4 年之前
父節點
當前提交
37c050bdbf
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5
    2
      __init__.py

+ 5
- 2
__init__.py 查看文件

@@ -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…
取消
儲存