remove debug feature to log all sql queries

This commit is contained in:
codl 2017-09-07 00:45:19 +02:00
parent b36a375a72
commit 208fee88ec
No known key found for this signature in database
GPG Key ID: 6CD7C8891ED1233A
1 changed files with 0 additions and 7 deletions

7
app.py
View File

@ -39,13 +39,6 @@ metadata = MetaData(naming_convention={
db = SQLAlchemy(app, metadata=metadata)
migrate = Migrate(app, db)
if 'SQLALCHEMY_LOG_QUERIES_TO' in app.config:
@event.listens_for(Engine, 'after_cursor_execute', named=True)
def log_queries(statement='', **kwargs):
with open(app.config['SQLALCHEMY_LOG_QUERIES_TO'], 'a') as f:
f.write(statement.replace('\n', ' ') + ';\n')
os.sync()
sentry = None
if 'SENTRY_DSN' in app.config:
from raven.contrib.flask import Sentry