fix: avoid confusing error message when connection to the murmur server fails.

This commit is contained in:
Terry Geng
2020-05-09 20:49:52 +08:00
parent a58af46f15
commit fbe3383b66
2 changed files with 9 additions and 1 deletions

View File

@ -345,7 +345,10 @@ class LoggerIOWrapper(io.TextIOWrapper):
def write(self, text):
if isinstance(text, bytes):
self.logger.log(self.logging_level, text.decode('utf-8').rstrip())
msg = text.decode('utf-8').rstrip()
self.logger.log(self.logging_level, msg)
super().write(msg + "\n")
else:
self.logger.log(self.logging_level, text.rstrip())
super().write(text + "\n")