Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test/utils.py Twisted log formatting hack #315

Closed
ShadowJonathan opened this issue Sep 18, 2020 · 1 comment · Fixed by #318
Closed

Fix test/utils.py Twisted log formatting hack #315

ShadowJonathan opened this issue Sep 18, 2020 · 1 comment · Fixed by #318

Comments

@ShadowJonathan
Copy link
Contributor

Apply the same fix from matrix-org/synapse#8335 onto the following lines:

sydent/tests/utils.py

Lines 234 to 245 in 66abd5b

class ToTwistedHandler(logging.Handler):
"""logging handler which sends the logs to the twisted log"""
tx_log = twisted.logger.Logger()
def emit(self, record):
log_entry = self.format(record)
log_level = record.levelname.lower().replace("warning", "warn")
self.tx_log.emit(
twisted.logger.LogLevel.levelWithName(log_level),
log_entry.replace("{", r"(").replace("}", r")"),
)

@ShadowJonathan ShadowJonathan changed the title Fix test/utils.py formatting hack Fix test/utils.py Twisted log formatting hack Sep 18, 2020
@anoadragon453
Copy link
Member

@ShadowJonathan would you mind creating a similar PR for this as the one you did for Synapse?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants