From 9ae66fb33bead4e2caea55759f888887206aa8e3 Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Fri, 4 Oct 2019 11:58:07 +0200 Subject: [PATCH] Logs notify messages on server --- openslides/core/websocket.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/openslides/core/websocket.py b/openslides/core/websocket.py index e5fa3dde9..2214c25ad 100644 --- a/openslides/core/websocket.py +++ b/openslides/core/websocket.py @@ -1,5 +1,6 @@ from typing import Any, Dict, Optional +from ..utils import logging from ..utils.auth import async_has_perm from ..utils.constants import get_constants from ..utils.projector import get_projector_data @@ -11,6 +12,9 @@ from ..utils.websocket import ( ) +logger = logging.getLogger(__name__) + + class NotifyWebsocketClientMessage(BaseWebsocketClientMessage): """ Websocket message from a client to send a message to other clients. @@ -64,6 +68,18 @@ class NotifyWebsocketClientMessage(BaseWebsocketClientMessage): in_response=id, ) else: + # Some logging + name = content.get("name", "") + users = content.get("users", []) + if users is True: + users = "all" + else: + users = ", ".join(users) + reply_channels = ", ".join(content.get("replyChannels", [])) + logger.info( + f"Got notify '{name}' from {consumer.channel_name} users={users} reply_channels={reply_channels}" + ) + # Forward to all other active site consumers to handle the notify message. await consumer.channel_layer.group_send( "site",