Browse Source

Mod: Change logger verbose level when handling emit and receive events

Info is too verbose for these events.
pull/1373/head
nghianv 8 months ago
parent
commit
9f0741ebcd
  1. 4
      src/socketio/async_client.py
  2. 4
      src/socketio/async_server.py
  3. 4
      src/socketio/client.py
  4. 4
      src/socketio/server.py

4
src/socketio/async_client.py

@ -224,7 +224,7 @@ class AsyncClient(base_client.BaseClient):
if namespace not in self.namespaces:
raise exceptions.BadNamespaceError(
namespace + ' is not a connected namespace.')
self.logger.info('Emitting event "%s" [%s]', event, namespace)
self.logger.debug('Emitting event "%s" [%s]', event, namespace)
if callback is not None:
id = self._generate_ack_id(namespace, callback)
else:
@ -405,7 +405,7 @@ class AsyncClient(base_client.BaseClient):
async def _handle_event(self, namespace, id, data):
namespace = namespace or '/'
self.logger.info('Received event "%s" [%s]', data[0], namespace)
self.logger.debug('Received event "%s" [%s]', data[0], namespace)
r = await self._trigger_event(data[0], namespace, *data[1:])
if id is not None:
# send ACK packet with the response returned by the handler

4
src/socketio/async_server.py

@ -173,7 +173,7 @@ class AsyncServer(base_server.BaseServer):
"""
namespace = namespace or '/'
room = to or room
self.logger.info('emitting event "%s" to %s [%s]', event,
self.logger.debug('emitting event "%s" to %s [%s]', event,
room or 'all', namespace)
await self.manager.emit(event, data, namespace, room=room,
skip_sid=skip_sid, callback=callback,
@ -589,7 +589,7 @@ class AsyncServer(base_server.BaseServer):
"""Handle an incoming client event."""
namespace = namespace or '/'
sid = self.manager.sid_from_eio_sid(eio_sid, namespace)
self.logger.info('received event "%s" from %s [%s]', data[0], sid,
self.logger.debug('received event "%s" from %s [%s]', data[0], sid,
namespace)
if not self.manager.is_connected(sid, namespace):
self.logger.warning('%s is not connected to namespace %s',

4
src/socketio/client.py

@ -213,7 +213,7 @@ class Client(base_client.BaseClient):
if namespace not in self.namespaces:
raise exceptions.BadNamespaceError(
namespace + ' is not a connected namespace.')
self.logger.info('Emitting event "%s" [%s]', event, namespace)
self.logger.debug('Emitting event "%s" [%s]', event, namespace)
if callback is not None:
id = self._generate_ack_id(namespace, callback)
else:
@ -382,7 +382,7 @@ class Client(base_client.BaseClient):
def _handle_event(self, namespace, id, data):
namespace = namespace or '/'
self.logger.info('Received event "%s" [%s]', data[0], namespace)
self.logger.debug('Received event "%s" [%s]', data[0], namespace)
r = self._trigger_event(data[0], namespace, *data[1:])
if id is not None:
# send ACK packet with the response returned by the handler

4
src/socketio/server.py

@ -161,7 +161,7 @@ class Server(base_server.BaseServer):
"""
namespace = namespace or '/'
room = to or room
self.logger.info('emitting event "%s" to %s [%s]', event,
self.logger.debug('emitting event "%s" to %s [%s]', event,
room or 'all', namespace)
self.manager.emit(event, data, namespace, room=room,
skip_sid=skip_sid, callback=callback,
@ -571,7 +571,7 @@ class Server(base_server.BaseServer):
"""Handle an incoming client event."""
namespace = namespace or '/'
sid = self.manager.sid_from_eio_sid(eio_sid, namespace)
self.logger.info('received event "%s" from %s [%s]', data[0], sid,
self.logger.debug('received event "%s" from %s [%s]', data[0], sid,
namespace)
if not self.manager.is_connected(sid, namespace):
self.logger.warning('%s is not connected to namespace %s',

Loading…
Cancel
Save