aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Joseph Banks <[email protected]>2020-02-21 22:48:20 +0000
committerGravatar Joseph Banks <[email protected]>2020-02-21 22:48:20 +0000
commit282a11ef2f52cf91464c1de056ac56b0a3a4c436 (patch)
tree1cfabc64dc45ca6659a54d8ed61ab8fcd406f8a7
parentMerge pull request #733 from kwzrd/unittest-antispam-rules (diff)
Enable logging warnings to Sentry
-rw-r--r--bot/__init__.py4
-rw-r--r--bot/__main__.py11
2 files changed, 12 insertions, 3 deletions
diff --git a/bot/__init__.py b/bot/__init__.py
index 923ef517b..90ab3c348 100644
--- a/bot/__init__.py
+++ b/bot/__init__.py
@@ -40,6 +40,6 @@ root_log.setLevel(TRACE_LEVEL if DEBUG_MODE else logging.INFO)
root_log.addHandler(stream_handler)
root_log.addHandler(file_handler)
-logging.getLogger("discord").setLevel(logging.ERROR)
-logging.getLogger("websockets").setLevel(logging.ERROR)
+logging.getLogger("discord").setLevel(logging.WARNING)
+logging.getLogger("websockets").setLevel(logging.WARNING)
logging.getLogger(__name__).setLevel(TRACE_LEVEL)
diff --git a/bot/__main__.py b/bot/__main__.py
index 2ed078903..490163739 100644
--- a/bot/__main__.py
+++ b/bot/__main__.py
@@ -1,13 +1,22 @@
+import logging
+
import discord
import sentry_sdk
from discord.ext.commands import when_mentioned_or
+from sentry_sdk.integrations.logging import LoggingIntegration
from bot import patches
from bot.bot import Bot
from bot.constants import Bot as BotConfig, DEBUG_MODE
+sentry_logging = LoggingIntegration(
+ level=logging.TRACE,
+ event_level=logging.WARNING
+)
+
sentry_sdk.init(
- dsn=BotConfig.sentry_dsn
+ dsn=BotConfig.sentry_dsn,
+ integrations=[sentry_logging]
)
bot = Bot(