From a161864ce72236424254bc893d0b4eab62156cf9 Mon Sep 17 00:00:00 2001 From: Brad Date: Sat, 11 Nov 2023 19:16:51 +1100 Subject: [PATCH] Add raw logging to betfair clients (#1337) --- nautilus_trader/adapters/betfair/data.py | 4 ++++ nautilus_trader/adapters/betfair/execution.py | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/nautilus_trader/adapters/betfair/data.py b/nautilus_trader/adapters/betfair/data.py index cc1202b46fbb..9ad86a5fe902 100644 --- a/nautilus_trader/adapters/betfair/data.py +++ b/nautilus_trader/adapters/betfair/data.py @@ -240,6 +240,10 @@ async def _unsubscribe_order_book_deltas(self, instrument_id: InstrumentId): # -- STREAMS ---------------------------------------------------------------------------------- def on_market_update(self, raw: bytes): + """ + Handle an update from the data stream socket. + """ + self._log.debug(f"raw_data: {raw.decode()}") update = stream_decode(raw) if isinstance(update, MCM): self._on_market_update(mcm=update) diff --git a/nautilus_trader/adapters/betfair/execution.py b/nautilus_trader/adapters/betfair/execution.py index 32639536fbaf..3bd082970eca 100644 --- a/nautilus_trader/adapters/betfair/execution.py +++ b/nautilus_trader/adapters/betfair/execution.py @@ -545,10 +545,9 @@ def handle_order_stream_update(self, raw: bytes) -> None: """ Handle an update from the order stream socket. """ + self._log.debug(f"raw_exec: {raw.decode()}") update = stream_decode(raw) - self._log.debug(f"Exec update: {raw.decode()}") - if isinstance(update, OCM): self.create_task(self._handle_order_stream_update(update)) elif isinstance(update, Connection):