当前位置 : 主页 > 编程语言 > python >

解决:sentry + loguru 不告警的问题

来源:互联网 收集:自由互联 发布时间:2022-06-15
解决办法: from loguru import logger from sentry_sdk.integrations.logging import ( LoggingIntegration, BreadcrumbHandler, EventHandler, ) . . . if settings.sentry_dsn: _ = logger.add( BreadcrumbHandler(level=logging.DEBUG), diagnose=se

解决办法:

from loguru import logger
from sentry_sdk.integrations.logging import (
LoggingIntegration,
BreadcrumbHandler,
EventHandler,
)


.
.
.


if settings.sentry_dsn:
_ = logger.add(
BreadcrumbHandler(level=logging.DEBUG),
diagnose=settings.loguru_diagnose,
level=logging.DEBUG,
)

_ = logger.add(
EventHandler(level=logging.ERROR),
diagnose=settings.loguru_diagnose,
level=logging.ERROR,
)

integrations = [
LoggingIntegration(level=None, event_level=None),
]

链接:​​https://github.com/getsentry/sentry-python/issues/653​​



作者:削微寒




上一篇:Python卸载,安装
下一篇:没有了
网友评论