.BANCHO. Add Sentry logging

This commit is contained in:
Nyo
2016-06-15 19:01:00 +02:00
parent ec2bce8893
commit 97262eda12
5 changed files with 77 additions and 38 deletions

View File

@@ -59,6 +59,9 @@ class config:
self.config.get("debug","packets")
self.config.get("debug","time")
self.config.get("sentry","enable")
self.config.get("sentry","dns")
self.config.get("discord","enable")
self.config.get("discord","boturl")
self.config.get("discord","devgroup")
@@ -95,6 +98,10 @@ class config:
self.config.set("debug", "packets", "0")
self.config.set("debug", "time", "0")
self.config.add_section("sentry")
self.config.set("sentry", "enable", "0")
self.config.set("sentry", "dns", "")
self.config.add_section("discord")
self.config.set("discord", "enable", "0")
self.config.set("discord", "boturl", "")

View File

@@ -3,6 +3,8 @@ import tornado.web
import tornado.gen
from tornado.ioloop import IOLoop
from objects import glob
from raven.contrib.tornado import SentryMixin
from raven.contrib.tornado import AsyncSentryClient
class asyncRequestHandler(tornado.web.RequestHandler):
"""
@@ -14,12 +16,18 @@ class asyncRequestHandler(tornado.web.RequestHandler):
@tornado.web.asynchronous
@tornado.gen.engine
def get(self, *args, **kwargs):
yield tornado.gen.Task(runBackground, (self.asyncGet, tuple(args), dict(kwargs)))
try:
yield tornado.gen.Task(runBackground, (self.asyncGet, tuple(args), dict(kwargs)))
except Exception as e:
yield tornado.gen.Task(self.captureException, exc_info=True)
@tornado.web.asynchronous
@tornado.gen.engine
def post(self, *args, **kwargs):
yield tornado.gen.Task(runBackground, (self.asyncPost, tuple(args), dict(kwargs)))
try:
yield tornado.gen.Task(runBackground, (self.asyncPost, tuple(args), dict(kwargs)))
except Exception as e:
yield tornado.gen.Task(self.captureException, exc_info=True)
def asyncGet(self, *args, **kwargs):
self.send_error(405)