Skip to content

Commit

Permalink
Fix / OrderBookTracker debug logging outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
TheHolyRoger committed Apr 1, 2021
1 parent 6ccb628 commit e742a34
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions hummingbot/core/data_type/order_book_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,13 @@ async def _track_single_book(self, trading_pair: str):
# Output some statistics periodically.
now: float = time.time()
if int(now / 60.0) > int(last_message_timestamp / 60.0):
self.logger().debug("Processed %d order book diffs for %s.",
diff_messages_accepted, trading_pair)
self.logger().debug(f"Processed {diff_messages_accepted} order book diffs for {trading_pair}.")
diff_messages_accepted = 0
last_message_timestamp = now
elif message.type is OrderBookMessageType.SNAPSHOT:
past_diffs: List[OrderBookMessage] = list(past_diffs_window)
order_book.restore_from_snapshot_and_diffs(message, past_diffs)
self.logger().debug("Processed order book snapshot for %s.", trading_pair)
self.logger().debug(f"Processed order book snapshot for {trading_pair}.")
except asyncio.CancelledError:
raise
except Exception:
Expand Down Expand Up @@ -307,9 +306,7 @@ async def _emit_trade_event_loop(self):
# Log some statistics.
now: float = time.time()
if int(now / 60.0) > int(last_message_timestamp / 60.0):
self.logger().debug("Trade messages processed: %d, rejected: %d",
messages_accepted,
messages_rejected)
self.logger().debug(f"Trade messages processed: {messages_accepted}, rejected: {messages_rejected}")
messages_accepted = 0
messages_rejected = 0

Expand Down

0 comments on commit e742a34

Please sign in to comment.