Logs a message being sent or received over the connection.
(self, direction, msg)
| 295 | return tmsg |
| 296 | |
| 297 | def _log_message(self, direction, msg): |
| 298 | """Logs a message being sent or received over the connection.""" |
| 299 | if direction == "send": |
| 300 | log_message = "Send message to " |
| 301 | elif direction == "receive": |
| 302 | log_message = "Received message from " |
| 303 | log_message += "%s:%d: %s" % (self.dstaddr, self.dstport, repr(msg)[:500]) |
| 304 | if len(log_message) > 500: |
| 305 | log_message += "... (msg truncated)" |
| 306 | logger.debug(log_message) |
| 307 | |
| 308 | |
| 309 | class P2PInterface(P2PConnection): |
no outgoing calls
no test coverage detected