def format(self, record) -> str:
        'Formats the log message as JSON.'

        kwargs = {}
        if isinstance(record.args, dict):
            kwargs = record.args

        record.msg = json.dumps(
            {
                'timestamp': datetime.now().astimezone(self.tz).isoformat(),
                'level':     record.levelname,
                'name':      record.name,
                'msg':       record.msg,
                'data':      kwargs,
            },
            default=_json_default,
        )
        return super().format(record)
Formats the log message as JSON.
durdraw/log.py