Skip to content

Commit

Permalink
Add raw logging to betfair clients (#1337)
Browse files Browse the repository at this point in the history
  • Loading branch information
limx0 authored Nov 11, 2023
1 parent a6e0cd7 commit a161864
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions nautilus_trader/adapters/betfair/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions nautilus_trader/adapters/betfair/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit a161864

Please sign in to comment.