Skip to content

Commit

Permalink
Fix / Bitfinex debug logging outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
TheHolyRoger committed Apr 1, 2021
1 parent bdfb5a6 commit ae6b47e
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,8 @@ async def _order_book_diff_router(self):
# Log some statistics.
now: float = time.time()
if int(now / CALC_STAT_MINUTE) > int(last_message_timestamp / CALC_STAT_MINUTE):
self.logger().debug("Diff messages processed: %d, rejected: %d, queued: %d",
messages_accepted,
messages_rejected,
messages_queued)
self.logger().debug(f"Diff messages processed: {messages_accepted}, "
f"rejected: {messages_rejected}, queued: {messages_queued}")
messages_accepted = 0
messages_rejected = 0
messages_queued = 0
Expand Down Expand Up @@ -171,8 +169,7 @@ async def _track_single_book(self, trading_pair: str):
# Output some statistics periodically.
now: float = time.time()
if int(now / CALC_STAT_MINUTE) > int(last_message_timestamp / CALC_STAT_MINUTE):
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
Expand All @@ -193,7 +190,7 @@ async def _track_single_book(self, trading_pair: str):
)
order_book.apply_diffs(d_bids, d_asks, diff_message.update_id)

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 as err:
Expand Down

0 comments on commit ae6b47e

Please sign in to comment.