瀏覽代碼

Adaption to new logging

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

+ 6
- 2
__init__.py 查看文件

@@ -33,8 +33,12 @@ import logging
33 33
 import socket
34 34
 import time
35 35
 
36
-logger_name = 'TCP_SOCKET'
37
-logger = logging.getLogger(logger_name)
36
+try:
37
+    from config import APP_NAME as ROOT_LOGGER_NAME
38
+except ImportError:
39
+    ROOT_LOGGER_NAME = 'root'
40
+
41
+logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__)
38 42
 
39 43
 
40 44
 class tcp_base(object):

Loading…
取消
儲存