formatters.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:djangolab 作者: DhiaTN 项目源码 文件源码
def format(self, record):

        sql = record.sql.strip()

        if sqlparse:
            # Indent the SQL query
            sql = sqlparse.format(sql, reindent=True)

        if pygments:
            # Highlight the SQL query
            sql = pygments.highlight(
                sql,
                SqlLexer(),
                Terminal256Formatter(style='monokai')
            )

        record.statement = sql
        return super(SQLFormatter, self).format(record)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号