Commit 74ebf6f2 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Packet logging improved thanks to Enum class.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@428 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 4dd996c2
......@@ -284,6 +284,9 @@ class Connection(BaseConnection):
if self.connector is None:
return
ip, port = self.getAddress()
logging.debug('#0x%04x %s to %s:%d', packet.getId(),
packet.getType(), *self.getAddress())
try:
self.write_buf.append(packet.encode())
except ProtocolError, m:
......
......@@ -75,8 +75,8 @@ class EventHandler(object):
def packetReceived(self, conn, packet):
"""Called when a packet is received."""
logging.debug('packet %d:%x received from %s:%d',
packet.getId(), packet.getType(), *(conn.getAddress()))
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):
......
This diff is collapsed.
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