[LNT] r257820 - Fix issue with exceptions not being logged
Chris Matthews via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 14 14:18:53 PST 2016
Author: cmatthews
Date: Thu Jan 14 16:18:53 2016
New Revision: 257820
URL: http://llvm.org/viewvc/llvm-project?rev=257820&view=rev
Log:
Fix issue with exceptions not being logged
Modified:
lnt/trunk/lnt/server/ui/app.py
Modified: lnt/trunk/lnt/server/ui/app.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/app.py?rev=257820&r1=257819&r2=257820&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/app.py (original)
+++ lnt/trunk/lnt/server/ui/app.py Thu Jan 14 16:18:53 2016
@@ -6,6 +6,7 @@ from logging import Formatter
import os
import time
import StringIO
+import traceback
import flask
from flask import current_app
@@ -21,7 +22,7 @@ import lnt.server.instance
import lnt.server.ui.filters
import lnt.server.ui.globals
import lnt.server.ui.views
-from lnt.testing.util.commands import warning
+from lnt.testing.util.commands import warning, error
import lnt.server.ui.regression_views
from lnt.server.ui.api import load_api_resources
import lnt.server.db.rules_manager
@@ -100,7 +101,14 @@ class Request(flask.Request):
return super(Request, self).close()
-class App(flask.Flask):
+class LNTExceptionLoggerFlask(flask.Flask):
+ def log_exception(self, exc_info):
+ # We need to stringify the traceback, since logs are sent via
+ # pickle.
+ error("Exception: " + traceback.format_exc())
+
+
+class App(LNTExceptionLoggerFlask):
@staticmethod
def create_with_instance(instance):
# Construct the application.
More information about the llvm-commits
mailing list