Skip to content

Commit

Permalink
use %r to __repr__ objects
Browse files Browse the repository at this point in the history
This avoids calculating __repr__ unless we are going to log.
  • Loading branch information
michaelkaye committed Oct 24, 2019
1 parent f85b984 commit 9eebc1e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion synapse/federation/federation_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def backfill(self, dest, room_id, limit, extremities):
dest, room_id, extremities, limit
)

logger.debug("backfill transaction_data=%s", repr(transaction_data))
logger.debug("backfill transaction_data=%r", transaction_data)

room_version = yield self.store.get_room_version(room_id)
format_ver = room_version_to_event_format(room_version)
Expand Down
4 changes: 2 additions & 2 deletions synapse/federation/transport/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ def backfill(self, destination, room_id, event_tuples, limit):
Deferred: Results in a dict received from the remote homeserver.
"""
logger.debug(
"backfill dest=%s, room_id=%s, event_tuples=%s, limit=%s",
"backfill dest=%s, room_id=%s, event_tuples=%r, limit=%s",
destination,
room_id,
repr(event_tuples),
event_tuples,
str(limit),
)

Expand Down
2 changes: 1 addition & 1 deletion synapse/storage/data_stores/main/event_federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def get_backfill_events(self, room_id, event_list, limit):

def _get_backfill_events(self, txn, room_id, event_list, limit):
logger.debug(
"_get_backfill_events: %s, %s, %s", room_id, repr(event_list), limit
"_get_backfill_events: %s, %r, %s", room_id, event_list, limit
)

event_results = set()
Expand Down

0 comments on commit 9eebc1e

Please sign in to comment.