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

Improve log messages.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2083 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 503f551b
...@@ -140,7 +140,7 @@ class HandlerSwitcher(object): ...@@ -140,7 +140,7 @@ class HandlerSwitcher(object):
if klass and isinstance(packet, klass) or packet.isError(): if klass and isinstance(packet, klass) or packet.isError():
handler.packetReceived(self._connection, packet) handler.packetReceived(self._connection, packet)
else: else:
logging.error('Unexpected answer: %r', packet) logging.error('Unexpected answer %r in %r', packet, self._connection)
notification = Packets.Notify('Unexpected answer: %r' % packet) notification = Packets.Notify('Unexpected answer: %r' % packet)
self._connection.notify(notification) self._connection.notify(notification)
self._connection.abort() self._connection.abort()
...@@ -148,7 +148,8 @@ class HandlerSwitcher(object): ...@@ -148,7 +148,8 @@ class HandlerSwitcher(object):
# apply a pending handler if no more answers are pending # apply a pending handler if no more answers are pending
while len(self._pending) > 1 and not self._pending[0][0]: while len(self._pending) > 1 and not self._pending[0][0]:
del self._pending[0] del self._pending[0]
logging.debug('Apply handler %r', self._pending[0][1]) logging.debug('Apply handler %r on %r', self._pending[0][1],
self._connection)
if timeout == self._next_timeout: if timeout == self._next_timeout:
# Find next timeout and its msg_id # Find next timeout and its msg_id
timeout_list = [] timeout_list = []
...@@ -166,11 +167,11 @@ class HandlerSwitcher(object): ...@@ -166,11 +167,11 @@ class HandlerSwitcher(object):
def setHandler(self, handler): def setHandler(self, handler):
if len(self._pending) == 1 and not self._pending[0][0]: if len(self._pending) == 1 and not self._pending[0][0]:
# nothing is pending, change immediately # nothing is pending, change immediately
logging.debug('Set handler %r', handler) logging.debug('Set handler %r on %r', handler, self._connection)
self._pending[0][1] = handler self._pending[0][1] = handler
else: else:
# put the next handler in queue # put the next handler in queue
logging.debug('Delay handler %r', handler) logging.debug('Delay handler %r on %r', handler, self._connection)
self._pending.append([{}, handler]) self._pending.append([{}, handler])
......
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