From eaa8b32dd7fd86c570358d29123e55767327e35b Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Wed, 16 Aug 2017 00:00:14 +0200 Subject: [PATCH] [sans-io] less verbose read/send logging --- mitmproxy/proxy2/commands.py | 4 ++++ mitmproxy/proxy2/events.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/mitmproxy/proxy2/commands.py b/mitmproxy/proxy2/commands.py index 003e48823..d9577cec3 100644 --- a/mitmproxy/proxy2/commands.py +++ b/mitmproxy/proxy2/commands.py @@ -52,6 +52,10 @@ class SendData(ConnectionCommand): super().__init__(connection) self.data = data + def __repr__(self): + target = type(self.connection).__name__.lower() + return f"SendData({target}, {self.data})" + class OpenConnection(ConnectionCommand): """ diff --git a/mitmproxy/proxy2/events.py b/mitmproxy/proxy2/events.py index 2659da300..3ae6b7fac 100644 --- a/mitmproxy/proxy2/events.py +++ b/mitmproxy/proxy2/events.py @@ -52,6 +52,10 @@ class DataReceived(ConnectionEvent): super().__init__(connection) self.data = data + def __repr__(self): + target = type(self.connection).__name__.lower() + return f"DataReceived({target}, {self.data})" + class CommandReply(Event): """