#!/usr/bin/env python3
from raven.handlers.logbook import SentryHandler

from home.settings import SENTRY_URL

try:
    import eventlet

    eventlet.monkey_patch()
    print('Using eventlet')
    create_thread_func = lambda f: f
    start_thread_func = lambda f: eventlet.spawn(f)
except ImportError:
    try:
        import gevent
        import gevent.monkey

        gevent.monkey.patch_all()
        print('Using gevent')
        create_thread_func = lambda f: gevent.Greenlet(f)
        start_thread_func = lambda t: t.start()
    except ImportError:
        import threading

        print('Using threading')
        create_thread_func = lambda f: threading.Thread(target=f)
        start_thread_func = lambda t: t.start()

import logging
import os
import sys
from logging.handlers import RotatingFileHandler

from home import settings
from home.core.parser import parse
from home.web.models import db_init
from home.web.utils import gen_guest_login
from home.web.web import socketio, app

sys.path.append(os.path.dirname(os.path.realpath(__file__)))

db_init()

try:
    parse(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'config.yml'))
except FileNotFoundError:
    print("Error: Create `config.yml` before starting! Start with `example-config.yml`.")
    raise SystemExit
handler = RotatingFileHandler('home.log', maxBytes=10000, backupCount=1)
handler.setLevel(logging.INFO)
handler.setFormatter(logging.Formatter("%(asctime)s: %(message)s"))
if SENTRY_URL:
    sentryhandler = SentryHandler(SENTRY_URL)
    sentryhandler.setLevel(logging.ERROR)
    app.logger.addHandler(sentryhandler)
app.logger.addHandler(handler)
app.logger.setLevel(logging.INFO)
gen_guest_login()
socketio.run(app, debug=settings.DEBUG)

@@ -20,96 +20,8 @@
 on3%0A
-from raven.handlers.logbook import SentryHandler%0A%0Afrom home.settings import SENTRY_URL%0A%0A
 try:
@@ -1376,152 +1376,8 @@
 %22))%0A
-if SENTRY_URL:%0A    sentryhandler = SentryHandler(SENTRY_URL)%0A    sentryhandler.setLevel(logging.ERROR)%0A    app.logger.addHandler(sentryhandler)%0A
 app.

Revert Sentry changes