Skip to content
This repository has been archived by the owner on Jan 24, 2018. It is now read-only.

Commit

Permalink
Merge pull request #1100 from kozbo/1099_fix_DEBUG
Browse files Browse the repository at this point in the history
Removed check for Debug so that we always log exceptions.
  • Loading branch information
dcolligan committed Apr 15, 2016
2 parents 33352b6 + d9019ed commit 1deb6f0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ga4gh/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import ga4gh.protocol as protocol
import ga4gh.exceptions as exceptions
import ga4gh.datarepo as datarepo
import logging
from logging import StreamHandler


MIMETYPE = "application/json"
Expand Down Expand Up @@ -188,6 +190,9 @@ def configure(configFile=None, baseConfig="ProductionConfig",
TODO Document this critical function! What does it do? What does
it assume?
"""
file_handler = StreamHandler()
file_handler.setLevel(logging.WARNING)
app.logger.addHandler(file_handler)
configStr = 'ga4gh.serverconfig:{0}'.format(baseConfig)
app.config.from_object(configStr)
if os.environ.get('GA4GH_CONFIGURATION') is not None:
Expand Down Expand Up @@ -340,7 +345,7 @@ def handleException(exception):
Handles an exception that occurs somewhere in the process of handling
a request.
"""
if app.config['DEBUG']:
with app.test_request_context():
app.log_exception(exception)
serverException = exception
if not isinstance(exception, exceptions.BaseServerException):
Expand Down

0 comments on commit 1deb6f0

Please sign in to comment.