diff options
| author | Vipin Balachandran <vbala@vmware.com> | 2016-11-18 15:25:45 +0530 |
|---|---|---|
| committer | Vipin Balachandran <vbala@vmware.com> | 2016-11-22 13:25:46 +0530 |
| commit | 80b28562eddb22c1add9ac950e689ee7bc586d93 (patch) | |
| tree | c97f444f87778d64e931c5489b52cc8e2bcc17fc /osprofiler/cmd | |
| parent | 7f8dfd65d269c14925734b14dd87fcbacb40d9fa (diff) | |
| download | osprofiler-80b28562eddb22c1add9ac950e689ee7bc586d93.tar.gz | |
Pretty print json output
Adding kwarg indent in json.dumps() to pretty print the trace
output in json format.
Change-Id: Icea772bd18e366ad576de7dbc2afc11b2fb376b9
Diffstat (limited to 'osprofiler/cmd')
| -rw-r--r-- | osprofiler/cmd/commands.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/osprofiler/cmd/commands.py b/osprofiler/cmd/commands.py index 99be83e..876493b 100644 --- a/osprofiler/cmd/commands.py +++ b/osprofiler/cmd/commands.py @@ -76,7 +76,8 @@ class TraceCommands(BaseCommand): return obj if args.use_json: - output = json.dumps(trace, default=datetime_json_serialize) + output = json.dumps(trace, default=datetime_json_serialize, + indent=2) elif args.use_html: with open(os.path.join(os.path.dirname(__file__), "template.html")) as html_template: |
