[V3 Sentry] Allow toggling of Sentry logging (#1214)

* Refactor sentry to allow toggle

* Rename sentry module

* Protect sentry manager

* Fix tests

* Fix EOF newlines

* Add docstrings
This commit is contained in:
Tobotimus
2018-01-15 15:26:26 +11:00
committed by GitHub
parent e18f94c17d
commit 73c08da037
6 changed files with 70 additions and 34 deletions

View File

@@ -1,12 +1,12 @@
import logging
from redbot.core import sentry_setup
from redbot.core import sentry
def test_sentry_capture(red):
log = logging.getLogger(__name__)
sentry_setup.init_sentry_logging(log)
mgr = sentry.SentryManager(log)
assert sentry_setup.client is not None
assert mgr.client is not None
sentry_setup.client.captureMessage("Message from test_sentry module.")
mgr.client.captureMessage("Message from test_sentry module.")