[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

@@ -10,7 +10,6 @@ from redbot.core.data_manager import load_basic_configuration, config_file
from redbot.core.json_io import JsonIO
from redbot.core.global_checks import init_global_checks
from redbot.core.events import init_events
from redbot.core.sentry_setup import init_sentry_logging
from redbot.core.cli import interactive_config, confirm, parse_cli_flags, ask_sentry
from redbot.core.core_commands import Core
from redbot.core.dev_commands import Dev
@@ -129,7 +128,7 @@ def main():
sys.exit(1)
loop.run_until_complete(_get_prefix_and_token(red, tmp_data))
if tmp_data['enable_sentry']:
init_sentry_logging(sentry_log)
red.enable_sentry()
cleanup_tasks = True
try:
loop.run_until_complete(red.start(token, bot=not cli_flags.not_bot))