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')
评论列表
文章目录