This commit is contained in:
liris
2015-04-17 09:35:37 +09:00
parent 56c4e9c7c1
commit 78c13538a4
3 changed files with 7 additions and 7 deletions

View File

@@ -231,6 +231,6 @@ class WebSocketApp(object):
callback(self, *args)
except Exception as e:
error(e)
if isEnableForDebug():
if isEnabledForDebug():
_, _, tb = sys.exc_info()
traceback.print_tb(tb)

View File

@@ -428,7 +428,7 @@ class WebSocket(object):
self.sock.settimeout(3)
try:
frame = self.recv_frame()
if isEnableForError():
if isEnabledForError():
recv_status = struct.unpack("!H", frame.data)[0]
if recv_status != STATUS_NORMAL:
error("close status: " + repr(recv_status))

View File

@@ -26,7 +26,7 @@ _logger = logging.getLogger()
_traceEnabled = False
__all__ = ["enableTrace", "dump", "error", "debug", "trace",
"isEnableForError", "isEnableForDebug"]
"isEnabledForError", "isEnabledForDebug"]
def enableTrace(tracable):
@@ -63,9 +63,9 @@ def trace(msg):
_logger.debug(msg)
def isEnableForError():
return _logger.isEnableFor(logging.ERROR)
def isEnabledForError():
return _logger.isEnabledFor(logging.ERROR)
def isEnableForDebug():
return _logger.isEnableFor(logging.DEBUG)
def isEnabledForDebug():
return _logger.isEnabledFor(logging.DEBUG)