Pretty print JSON in debug mode (debug level >= 2)

Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
Christian Heimes
2017-02-13 19:09:14 +01:00
committed by Martin Basti
parent b12b1e4c0b
commit 3cac0378e9
2 changed files with 58 additions and 42 deletions

View File

@@ -483,7 +483,9 @@ class jsonserver(WSGIExecutioner, HTTP_Status):
principal=unicode(principal),
version=unicode(VERSION),
)
dump = json_encode_binary(response, version)
dump = json_encode_binary(
response, version, pretty_print=self.api.env.debug >= 2
)
return dump.encode('utf-8')
def unmarshal(self, data):