Sentry error logging (#784)

This commit is contained in:
Will
2017-05-29 16:43:00 -04:00
committed by Twentysix
parent e469ee201b
commit 82d9457647
6 changed files with 84 additions and 4 deletions

View File

@@ -1,6 +1,8 @@
import argparse
import asyncio
from core.bot import Red
def confirm(m=""):
return input(m).lower().strip() in ("y", "yes")
@@ -39,9 +41,26 @@ def interactive_config(red, token_set, prefix_set):
if prefix:
loop.run_until_complete(red.db.set("prefix", [prefix]))
ask_sentry(red)
return token
def ask_sentry(red: Red):
loop = asyncio.get_event_loop()
print("\nThank you for installing Red V3 alpha! The current version\n"
" is not suited for production use and is aimed at testing\n"
" the current and upcoming featureset, that's why we will\n"
" also collect the fatal error logs to help us fix any new\n"
" found issues in a timely manner. If you wish to opt in\n"
" the process please type \"yes\":\n")
if not confirm("> "):
loop.run_until_complete(red.db.set("enable_sentry", False))
else:
loop.run_until_complete(red.db.set("enable_sentry", True))
print("\nThank you for helping us with the development process!")
def parse_cli_flags():
parser = argparse.ArgumentParser(description="Red - Discord Bot")
parser.add_argument("--owner", help="ID of the owner. Only who hosts "
@@ -83,4 +102,4 @@ def parse_cli_flags():
else:
args.prefix = []
return args
return args