Skip to content
This repository has been archived by the owner on May 28, 2022. It is now read-only.

Commit

Permalink
Make logerrback argument order more consistent.
Browse files Browse the repository at this point in the history
  • Loading branch information
posita committed Nov 18, 2015
1 parent bd3be6d commit 240b264
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions txsocketio/engineio.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ def _connected(_passthru):

d.addCallback(_connected)
d.addErrback(self._shutitdown, lose_connection=True)
d.addErrback(txrc.logging.logerrback, logger=_LOGGER, msg='Failure while connecting:')
d.addErrback(txrc.logging.logerrback, log_lvl=logging.DEBUG, logger=_LOGGER, msg='Failure while connecting:')

return d

Expand All @@ -644,7 +644,7 @@ def _done(_passthru):
d.addErrback(self._stopconnecting)
d.addErrback(self._shutitdown, lose_connection=True)
# handled = ( t_defer.CancelledError, t_client.ResponseFailed, UnknownSessionIdError )
# d.addErrback(txrc.logging.logerrback, logger=_LOGGER, log_lvl=logging.WARNING, msg='Failure raised when sending packet <{}:{!r}>:'.format(EIO_TYPE_NAMES_BY_CODE.get(_packet_type, '[WTF?! UNKNOWN PACKET TYPE?!]'), _packet_data), handled=handled)
# d.addErrback(txrc.logging.logerrback, log_lvl=logging.WARNING, logger=_LOGGER, msg='Failure raised when sending packet <{}:{!r}>:'.format(EIO_TYPE_NAMES_BY_CODE.get(_packet_type, '[WTF?! UNKNOWN PACKET TYPE?!]'), _packet_data), handled=handled)

return d

Expand Down Expand Up @@ -799,7 +799,7 @@ def _receiveloop(self, _=None):
self._receiving_d.addErrback(self._stopconnecting)
self._receiving_d.addErrback(self._shutitdown, lose_connection=True, stop_packets_loop=False)
handled = ( t_defer.CancelledError, t_client.ResponseFailed, ReceivedClosePacket, UnknownSessionIdError )
self._receiving_d.addErrback(txrc.logging.logerrback, logger=_LOGGER, log_lvl=logging.WARNING, msg='Failure raised when retrieving packets:', handled=handled)
self._receiving_d.addErrback(txrc.logging.logerrback, log_lvl=logging.WARNING, logger=_LOGGER, msg='Failure raised when retrieving packets:', handled=handled)

def _sendpacket(self, packet_type, packet_data=''):
packet = enceiopacket(packet_type, packet_data)
Expand Down Expand Up @@ -880,7 +880,7 @@ def _trysendclose(_passthru):
# :exc:`~twisted.internet.defer.CancelledError` as handled
_d = self._sendpacket(EIO_TYPE_CLOSE)
handled = ( t_defer.CancelledError, UnknownSessionIdError, )
_d.addErrback(txrc.logging.logerrback, logger=_LOGGER, log_lvl=logging.WARNING, msg='Failure raised when sending close packet:', handled=handled)
_d.addErrback(txrc.logging.logerrback, log_lvl=logging.WARNING, logger=_LOGGER, msg='Failure raised when sending close packet:', handled=handled)
_d.addBoth(lambda _: _passthru)

return _d
Expand Down Expand Up @@ -910,7 +910,7 @@ def _stopreceiveloop(_passthru):

def _stoppool(_passthru):
_d = self._pool.closeCachedConnections()
_d.addErrback(txrc.logging.logerrback, logger=_LOGGER, msg='Failure in shutting down pool:')
_d.addErrback(txrc.logging.logerrback, log_lvl=logging.DEBUG, logger=_LOGGER, msg='Failure in shutting down pool:')
_d.addBoth(lambda _: _passthru)

return _d
Expand Down Expand Up @@ -944,7 +944,7 @@ def _stopconnectingimpl():

d = _stopconnectingimpl()
handled = ( t_defer.CancelledError, t_error.ConnectingCancelledError )
d.addErrback(txrc.logging.logerrback, logger=_LOGGER, msg='Failure raised when canceling pending connection:', handled=handled, suppress_msg_on_handled=False)
d.addErrback(txrc.logging.logerrback, log_lvl=logging.DEBUG, logger=_LOGGER, msg='Failure raised when canceling pending connection:', handled=handled, suppress_msg_on_handled=False)
d.addBoth(lambda _: passthru)

return d
Expand Down Expand Up @@ -1176,7 +1176,7 @@ def _sendping():
_d = self.sendeiopacket(EIO_TYPE_PING, 'probe')
_d.addCallback(_loop)
handled = ( t_defer.CancelledError, t_client.ResponseFailed, ReceivedClosePacket, UnknownSessionIdError )
_d.addErrback(txrc.logging.logerrback, logger=_LOGGER, log_lvl=logging.WARNING, msg='Failure raised when pinging:', handled=handled)
_d.addErrback(txrc.logging.logerrback, log_lvl=logging.WARNING, logger=_LOGGER, msg='Failure raised when pinging:', handled=handled)

return _d

Expand Down

0 comments on commit 240b264

Please sign in to comment.