sentry.py 文件源码

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

项目:antenna 作者: mozilla-services 项目源码 文件源码
def set_sentry_client(sentry_dsn, basedir):
    """Sets a Sentry client using a given sentry_dsn

    To clear the client, pass in something falsey like ``''`` or ``None``.

    """
    global _sentry_client
    if sentry_dsn:
        version_info = get_version_info(basedir)
        commit = version_info.get('commit')[:8]

        _sentry_client = Client(
            dsn=sentry_dsn,
            include_paths=['antenna'],
            tags={'commit': commit}
        )
        logger.info('Set up sentry client')
    else:
        _sentry_client = None
        logger.info('Removed sentry client')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号