From f2ca5d13e07ab0136b51d6b863a3f59791c15a7f Mon Sep 17 00:00:00 2001 From: Joseph Banks Date: Wed, 25 Mar 2020 23:57:23 +0000 Subject: Setup Sentry --- bot/__main__.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'bot/__main__.py') diff --git a/bot/__main__.py b/bot/__main__.py index a169257f..2e68a9a4 100644 --- a/bot/__main__.py +++ b/bot/__main__.py @@ -1,9 +1,22 @@ import logging +import sentry_sdk +from sentry_sdk.integrations.logging import LoggingIntegration + from bot.bot import bot from bot.constants import Client, STAFF_ROLES, WHITELISTED_CHANNELS from bot.decorators import in_channel_check +sentry_logging = LoggingIntegration( + level=logging.DEBUG, + event_level=logging.WARNING +) + +sentry_sdk.init( + dsn=Client.sentry_dsn, + integrations=[sentry_logging] +) + log = logging.getLogger(__name__) bot.add_check(in_channel_check(*WHITELISTED_CHANNELS, bypass_roles=STAFF_ROLES)) -- cgit v1.2.3