aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/har_dump.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/har_dump.py b/examples/har_dump.py
index 5acd8bfa..56508cdc 100644
--- a/examples/har_dump.py
+++ b/examples/har_dump.py
@@ -120,10 +120,12 @@ def done():
mitmproxy.ctx.log(pprint.pformat(HAR))
# TODO: .zhar compression
else:
+ json_dump = json.dumps(HAR, indent=2)
+
with open(dump_file, "w") as f:
- f.write(json.dumps(HAR, indent=2))
+ f.write(json_dump)
- # TODO: Log results via mitmproxy.ctx.log
+ mitmproxy.ctx.log("HAR log finished (wrote %s bytes to file)" % len(json_dump))
def format_datetime(dt):