Add __repr__ to Json object for better logging

Currently, attempt to log or print Json object uses default python's implementation which is useless. Using actual serialized content is much better.
This commit is contained in:
Oleg Anashkin 2014-02-02 20:17:59 -08:00
parent 66f85b5832
commit 10feb5350d

View File

@ -73,6 +73,9 @@ class Json(object):
if proto is ISQLQuote:
return self
def __repr__(self):
return self.dumps()
def dumps(self, obj):
"""Serialize *obj* in JSON format.