[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

@@ -476,6 +476,23 @@ class Core:
await ctx.send(_("Locale has been set."))
@_set.command()
@checks.is_owner()
async def sentry(self, ctx: commands.Context, on_or_off: bool):
"""Enable or disable Sentry logging.
Sentry is the service Red uses to manage error reporting. This should
be disabled if you have made your own modifications to the redbot
package.
"""
await ctx.bot.db.enable_sentry.set(on_or_off)
if on_or_off:
ctx.bot.enable_sentry()
await ctx.send(_("Done. Sentry logging is now enabled."))
else:
ctx.bot.disable_sentry()
await ctx.send(_("Done. Sentry logging is now disabled."))
@commands.command()
@commands.cooldown(1, 60, commands.BucketType.user)
async def contact(self, ctx, *, message: str):
@@ -705,4 +722,3 @@ class Core:
async def rpc_reload(self, request):
await self.rpc_unload(request)
await self.rpc_load(request)