modifié: m/log.py
modifié: superTornado.py
This commit is contained in:
parent
44e08015dd
commit
64c0ae1553
3
m/log.py
3
m/log.py
@ -24,9 +24,10 @@ class Log(object):
|
|||||||
self.logger.addHandler(file_handler_error)
|
self.logger.addHandler(file_handler_error)
|
||||||
|
|
||||||
steam_handler = logging.StreamHandler()
|
steam_handler = logging.StreamHandler()
|
||||||
steam_handler.setLevel(logging.DEBUG)
|
steam_handler.setLevel(logging.NOTSET)
|
||||||
self.logger.addHandler(steam_handler)
|
self.logger.addHandler(steam_handler)
|
||||||
|
|
||||||
|
|
||||||
def printL(self,pMsg,pLvl):
|
def printL(self,pMsg,pLvl):
|
||||||
if pLvl == 10 :
|
if pLvl == 10 :
|
||||||
pMsg = bcolors.DEBUG + pMsg + bcolors.ENDC
|
pMsg = bcolors.DEBUG + pMsg + bcolors.ENDC
|
||||||
|
@ -135,7 +135,7 @@ class WSocketHandler(BaseHandler,tornado.websocket.WebSocketHandler):
|
|||||||
data = f.read()
|
data = f.read()
|
||||||
encoded = base64.b64encode(data)
|
encoded = base64.b64encode(data)
|
||||||
self.write_message(encoded)
|
self.write_message(encoded)
|
||||||
log.printL( "->Data send : " + self.request.remote_ip, 10)
|
log.printL( "->Data send : " + self.request.remote_ip, 20)
|
||||||
except Exception, e :
|
except Exception, e :
|
||||||
log.printL(e.value,40)
|
log.printL(e.value,40)
|
||||||
self.write_message("error")
|
self.write_message("error")
|
||||||
|
Reference in New Issue
Block a user