diff --git a/examples/read_dumpfile b/examples/read_dumpfile index ecddc65d9..eb1c93bbf 100755 --- a/examples/read_dumpfile +++ b/examples/read_dumpfile @@ -5,15 +5,17 @@ from libmproxy import flow import json +import pprint import sys with open(sys.argv[1], "rb") as logfile: freader = flow.FlowReader(logfile) + pp = pprint.PrettyPrinter(indent=4) try: for f in freader.stream(): print(f) print(f.request.host) - json.dump(f.get_state(), sys.stdout, indent=4) + pp.pprint(f.get_state()) print("") except flow.FlowReadError as v: print "Flow file corrupted. Stopped loading."