Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
12 lines (10 sloc) 391 Bytes
import traceback
import sys
class ViewErrorLoggingMiddleware:
def process_view(self, request, view_func, view_args, view_kwargs):
self.view_name = view_func.__name__
def process_exception(self, request, exception):
print '=' * 60
print '[ERROR] exception in view "%s"' % self.view_name
traceback.print_exc(file=sys.stdout)
print '=' * 60