<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __obj2json(self, obj):
 """Serialize obj to a JSON formatted string. This is useful for pretty printing log records in the console. """

        return json.dumps(obj, indent=self._indent, sort_keys=self._sort_keys)