code: def __obj2json(self, obj):
          
          return json.dumps(obj, indent=self._indent, sort_keys=self._sort_keys)
docs: Serialize obj to a JSON formatted string.
  
          This is useful for pretty printing log records in the console.