Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Use %r rather than %s for stringifying events #8679

Merged
merged 1 commit into from
Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/8679.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Clarify representation of events in logfiles.
4 changes: 2 additions & 2 deletions synapse/events/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def __str__(self):
return self.__repr__()

def __repr__(self):
return "<FrozenEvent event_id='%s', type='%s', state_key='%s'>" % (
return "<FrozenEvent event_id=%r, type=%r, state_key=%r>" % (
self.get("event_id", None),
self.get("type", None),
self.get("state_key", None),
Expand Down Expand Up @@ -451,7 +451,7 @@ def __str__(self):
return self.__repr__()

def __repr__(self):
return "<%s event_id='%s', type='%s', state_key='%s'>" % (
return "<%s event_id=%r, type=%r, state_key=%r>" % (
self.__class__.__name__,
self.event_id,
self.get("type", None),
Expand Down