Davidliu 3 月之前
父节点
当前提交
906c34c879
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 2 4
      src/core/callcenter/ws.py

+ 2 - 4
src/core/callcenter/ws.py

@@ -18,18 +18,16 @@ redis_handler = RedisHandler()
 
 def listen_to_redis():
     """监听 Redis 频道并将消息广播到 SocketIO 客户端"""
-    print("daviddebugger:: begin subscribe socket_channel 111")
     pubsub = redis_handler.redis.pubsub()
     pubsub.subscribe('socket_channel')
-    print("daviddebugger:: begin subscribe socket_channel")
+    logger.info("begin subscribe socket_channel")
     for message in pubsub.listen():
-        print("daviddebugger:: come in %s"%message)
         if message['type'] == 'message':
             data = json.loads(message['data'])
             user_id = data.get('user_id')
             event = data.get('event')
             payload = data.get('data')
-            print("daviddebugger::user_id=%s, event=%s, data=%s" % (user_id, event, payload))
+            logger.info("daviddebugger::user_id=%s, event=%s, data=%s" % (user_id, event, payload))
             # 通过 emit 广播消息到用户所在的房间
             # emit(event, payload, room=user_id, namespace='/ws/cs-im')
             socketio.emit(event, payload, room=user_id, namespace='/ws/cs-im')