summaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2010-06-07 15:42:31 +0100
committerLuiz Capitulino <lcapitulino@redhat.com>2010-10-01 10:12:43 -0300
commit39eaab9ac2a82f5370758e8aeb8b7196f34fdabf (patch)
treea029d0fe781de3f145cfa9d9ec766ad6692e9a99 /monitor.c
parent212b6008686369b288a2b71e4f1b25f07d854763 (diff)
Add option to turn on JSON pretty printing in monitor
Expaned '-mon' arg to allow a 'pretty=on' flag. This makes the monitor pretty print its replies to easy human debugging / reading Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/monitor.c b/monitor.c
index e602480ebb..a33cdc2a00 100644
--- a/monitor.c
+++ b/monitor.c
@@ -351,7 +351,10 @@ static void monitor_json_emitter(Monitor *mon, const QObject *data)
{
QString *json;
- json = qobject_to_json(data);
+ if (mon->flags & MONITOR_USE_PRETTY)
+ json = qobject_to_json_pretty(data);
+ else
+ json = qobject_to_json(data);
assert(json != NULL);
qstring_append_chr(json, '\n');