diff options
| author | 2020-02-21 02:51:21 +0000 | |
|---|---|---|
| committer | 2020-02-21 02:51:21 +0000 | |
| commit | 7cfb72f0b25647da2b2b5e83daedc22ca5bdfe23 (patch) | |
| tree | fbf3eb664c14f556529a14e042511a699f62f8f7 | |
| parent | Merge pull request #761 from python-discord/logging (diff) | |
Implement basic Sentry SDK usage
| -rw-r--r-- | Pipfile | 1 | ||||
| -rw-r--r-- | Pipfile.lock | 10 | ||||
| -rw-r--r-- | bot/__main__.py | 2 | ||||
| -rw-r--r-- | bot/constants.py | 2 | ||||
| -rw-r--r-- | config-default.yml | 1 |
5 files changed, 14 insertions, 2 deletions
@@ -18,6 +18,7 @@ deepdiff = "~=4.0" requests = "~=2.22" more_itertools = "~=7.2" urllib3 = ">=1.24.2,<1.25" +sentry-sdk = "~=0.14" [dev-packages] coverage = "~=4.5" diff --git a/Pipfile.lock b/Pipfile.lock index 633e62887..fa29bf995 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "560a5168f32bafd9e5173d49502e10aeb278fe64ed50262da29be208f4a66739" + "sha256": "c7706a61eb96c06d073898018ea2dbcf5bd3b15d007496e2d60120a65647f31e" }, "pipfile-spec": 6, "requires": { @@ -413,6 +413,14 @@ "index": "pypi", "version": "==2.23.0" }, + "sentry-sdk": { + "hashes": [ + "sha256:b06dd27391fd11fb32f84fe054e6a64736c469514a718a99fb5ce1dff95d6b28", + "sha256:e023da07cfbead3868e1e2ba994160517885a32dfd994fc455b118e37989479b" + ], + "index": "pypi", + "version": "==0.14.1" + }, "six": { "hashes": [ "sha256:236bdbdce46e6e6a3d61a337c0f8b763ca1e8717c03b369e87a7ec7ce1319c0a", diff --git a/bot/__main__.py b/bot/__main__.py index 84bc7094b..4f51a08cc 100644 --- a/bot/__main__.py +++ b/bot/__main__.py @@ -1,10 +1,12 @@ import discord +import sentry_sdk from discord.ext.commands import when_mentioned_or from bot import patches from bot.bot import Bot from bot.constants import Bot as BotConfig, DEBUG_MODE +sentry_sdk.init(BotConfig.sentry_dsn) bot = Bot( command_prefix=when_mentioned_or(BotConfig.prefix), diff --git a/bot/constants.py b/bot/constants.py index fe8e57322..a4c65a1f8 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -193,7 +193,7 @@ class Bot(metaclass=YAMLGetter): prefix: str token: str - + sentry_dsn: str class Filter(metaclass=YAMLGetter): section = "filter" diff --git a/config-default.yml b/config-default.yml index 3345e6f2a..2eaf8ee06 100644 --- a/config-default.yml +++ b/config-default.yml @@ -1,6 +1,7 @@ bot: prefix: "!" token: !ENV "BOT_TOKEN" + sentry_dsn: !ENV "BOT_SENTRY_DSN" cooldowns: # Per channel, per tag. |