use pythons logging infrastructure

This commit is contained in:
Jakob Ketterl
2019-05-10 21:50:58 +02:00
parent 6243a297c0
commit e15359a106
6 changed files with 44 additions and 26 deletions

View File

@ -2,6 +2,9 @@ import base64
import hashlib
import json
import logging
logger = logging.getLogger(__name__)
class WebSocketConnection(object):
def __init__(self, handler, messageHandler):
self.handler = handler
@ -67,7 +70,7 @@ class WebSocketConnection(object):
open = False
self.messageHandler.handleClose(self)
else:
print("unsupported opcode: {0}".format(opcode))
logger.warn("unsupported opcode: {0}".format(opcode))
class WebSocketException(Exception):
pass