Commit c1b3044a authored by Grégory Wisniewski's avatar Grégory Wisniewski

Add UUIDs in packet log output.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@430 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent d3f74a0e
......@@ -23,6 +23,7 @@ import traceback
from neo.protocol import Packet, ProtocolError
from neo.event import IdleEvent
from neo.connector import ConnectorTryAgainException, ConnectorInProgressException
from neo.util import dump
def lockCheckWrapper(func):
"""
......@@ -225,6 +226,8 @@ class Connection(BaseConnection):
except KeyError:
pass
logging.debug('#0x%04x %-30s from %s (%s:%d)', packet.getId(),
packet.getType(), dump(self.uuid), *self.getAddress())
self.handler.packetReceived(self, packet)
msg = msg[len(packet):]
......@@ -285,8 +288,8 @@ class Connection(BaseConnection):
return
ip, port = self.getAddress()
logging.debug('#0x%04x %s to %s:%d', packet.getId(),
packet.getType(), *self.getAddress())
logging.debug('#0x%04x %-30s to %s (%s:%d)', packet.getId(),
packet.getType(), dump(self.uuid), *self.getAddress())
try:
self.write_buf.append(packet.encode())
except ProtocolError, m:
......
......@@ -75,8 +75,6 @@ class EventHandler(object):
def packetReceived(self, conn, packet):
"""Called when a packet is received."""
logging.debug('#0x%04x %s from %s:%d',
packet.getId(), packet.getType(), *conn.getAddress())
self.dispatch(conn, packet)
def packetMalformed(self, conn, packet, error_message):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment