Explorar el Código

Adaption to new logging

master
Dirk Alders hace 4 años
padre
commit
576494b200
Se han modificado 1 ficheros con 6 adiciones y 2 borrados
  1. 6
    2
      __init__.py

+ 6
- 2
__init__.py Ver fichero

@@ -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…
Cancelar
Guardar