diff options
author | 2021-11-12 07:48:51 +0100 | |
---|---|---|
committer | 2021-11-12 07:48:51 +0100 | |
commit | ec5eaadaae3e92f742f49085f782be40195a891c (patch) | |
tree | d7406eed339a63be27024c410b16d54987056007 /bot/__init__.py | |
parent | Merge pull request #858 from Numerlor/coloredlogs (diff) | |
parent | Move Sentry Into Init (diff) |
Merge pull request #943 from python-discord/file-log-debug
Fix Startup Crash Loop
Diffstat (limited to 'bot/__init__.py')
-rw-r--r-- | bot/__init__.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/bot/__init__.py b/bot/__init__.py index b19bd76a..ae53a5a5 100644 --- a/bot/__init__.py +++ b/bot/__init__.py @@ -6,14 +6,32 @@ except ModuleNotFoundError: pass import asyncio +import logging import os from functools import partial, partialmethod import arrow +import sentry_sdk from discord.ext import commands +from sentry_sdk.integrations.logging import LoggingIntegration +from sentry_sdk.integrations.redis import RedisIntegration from bot import log, monkey_patches +sentry_logging = LoggingIntegration( + level=logging.DEBUG, + event_level=logging.WARNING +) + +sentry_sdk.init( + dsn=os.environ.get("BOT_SENTRY_DSN"), + integrations=[ + sentry_logging, + RedisIntegration() + ], + release=f"sir-lancebot@{os.environ.get('GIT_SHA', 'foobar')}" +) + log.setup() # Set timestamp of when execution started (approximately) |