From 2ddb2639bfa16cc551b89a7c46810c7fb44cbc06 Mon Sep 17 00:00:00 2001 From: hkc Date: Mon, 3 Jul 2023 17:03:20 +0300 Subject: [PATCH] Print every received event in debug mode --- mastoposter/sources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mastoposter/sources.py b/mastoposter/sources.py index b1f6e85..749ad4d 100644 --- a/mastoposter/sources.py +++ b/mastoposter/sources.py @@ -34,13 +34,13 @@ async def websocket_source( async with connect(url) as ws: while (msg := await ws.recv()) is not None: event = loads(msg) + logger.debug("data: %r", event) if "error" in event: raise Exception(event["error"]) if event["event"] == "update": yield Status.from_dict(loads(event["payload"])) else: logger.warn("unknown event type %r", event["event"]) - logger.debug("data: %r", event) except ( WebSocketException, TimeoutError,