Skip to content

Commit

Permalink
Fix problem where the "message" in the connection report log was an o…
Browse files Browse the repository at this point in the history
…bject and not a string
  • Loading branch information
Res260 committed Jul 21, 2019
1 parent 20c672b commit afdfd9d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pyrdp/logging/StatCounter.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,9 @@ def stop(self):
self.stats[STAT.CLIENT_SERVER_RATIO] = self.stats[STAT.TOTAL_INPUT] / self.stats[STAT.TOTAL_OUTPUT]

def logReport(self, log: LoggerAdapter):
log.info("Connection report", self.stats)
"""
Create an INFO log message to log the Connection report using the keys in self.stats.
:param log: Logger to use to log the report
"""
keys = "".join([f"{key}: %({key})s " for key in self.stats.keys()])
log.info(f"Connection report: {keys}", self.stats)

0 comments on commit afdfd9d

Please sign in to comment.