Skip to content

Commit f4b635e

Browse files
committed
fix: warning -> logging
1 parent 37f94fe commit f4b635e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/socketio/packet.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import functools
2-
import warnings
2+
import logging
33
from engineio import json as _json
44

55
(CONNECT, DISCONNECT, EVENT, ACK, CONNECT_ERROR, BINARY_EVENT, BINARY_ACK) = \
66
(0, 1, 2, 3, 4, 5, 6)
77
packet_names = ['CONNECT', 'DISCONNECT', 'EVENT', 'ACK', 'CONNECT_ERROR',
88
'BINARY_EVENT', 'BINARY_ACK']
99

10+
logger = logging.getLogger('socketio.packet')
1011

1112
class Packet:
1213
"""Socket.IO packet."""
@@ -202,12 +203,13 @@ def configure(cls, *args, **kwargs):
202203
try:
203204
args_hash = hash(configure_args)
204205
except TypeError:
205-
warnings.warn('Packet.configure() called with unhashable '
206-
'arguments; subclass caching will not work.',
207-
RuntimeWarning)
206+
logger.warning("Packet.configure() called with unhashable "
207+
"arguments; subclass caching will not work.")
208208
args_hash = None
209209

210210
if args_hash in cls._subclass_registry:
211+
logger.debug("Using cached Packet subclass for args %s, %s",
212+
args, kwargs)
211213
return cls._subclass_registry[args_hash]
212214
return cls._configure(*args, **kwargs)
213215

0 commit comments

Comments
 (0)