diff options
author | Maximilian Hils <git@maximilianhils.com> | 2018-05-08 15:24:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-08 15:24:02 +0200 |
commit | 0c101a4bccfb8460a11691cc17467d47d1974b2f (patch) | |
tree | cac672a0bfa819eac359db5ec1621d1c4de06aaf /examples/complex/nonblocking.py | |
parent | ad74c18f74256537fd22037e8aec0e9707773fa0 (diff) | |
parent | 7d9b626d2ed304de0f5aa6083c782dcd00ed51dc (diff) | |
download | mitmproxy-0c101a4bccfb8460a11691cc17467d47d1974b2f.tar.gz mitmproxy-0c101a4bccfb8460a11691cc17467d47d1974b2f.tar.bz2 mitmproxy-0c101a4bccfb8460a11691cc17467d47d1974b2f.zip |
Merge pull request #3106 from cortesi/noprint
Ditch the addon stdout wrapper
Diffstat (limited to 'examples/complex/nonblocking.py')
-rw-r--r-- | examples/complex/nonblocking.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/complex/nonblocking.py b/examples/complex/nonblocking.py index 264a1fdb..72c9c0ab 100644 --- a/examples/complex/nonblocking.py +++ b/examples/complex/nonblocking.py @@ -1,11 +1,12 @@ import time from mitmproxy.script import concurrent +from mitmproxy import ctx @concurrent # Remove this and see what happens def request(flow): # You don't want to use mitmproxy.ctx from a different thread - print("handle request: %s%s" % (flow.request.host, flow.request.path)) + ctx.log.info("handle request: %s%s" % (flow.request.host, flow.request.path)) time.sleep(5) - print("start request: %s%s" % (flow.request.host, flow.request.path)) + ctx.log.info("start request: %s%s" % (flow.request.host, flow.request.path)) |