Update test logging to be able to accept braces (#8335)

This commit is contained in:
Jonathan de Jong 2020-09-18 13:56:40 +02:00 committed by GitHub
parent 5e42e61609
commit 7c407efdc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

1
changelog.d/8335.misc Normal file
View File

@ -0,0 +1 @@
Fix test logging to allow braces in log output.

View File

@ -29,8 +29,7 @@ class ToTwistedHandler(logging.Handler):
log_entry = self.format(record) log_entry = self.format(record)
log_level = record.levelname.lower().replace("warning", "warn") log_level = record.levelname.lower().replace("warning", "warn")
self.tx_log.emit( self.tx_log.emit(
twisted.logger.LogLevel.levelWithName(log_level), twisted.logger.LogLevel.levelWithName(log_level), "{entry}", entry=log_entry
log_entry.replace("{", r"(").replace("}", r")"),
) )