Middleware for printing of exception to console

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
class ConsoleExceptionMiddleware:
    def process_exception(self, request, exception):
        import traceback
        import sys
        exc_info = sys.exc_info()
        print "######################## Exception #############################"
        print '\n'.join(traceback.format_exception(*(exc_info or sys.exc_info())))
        print "################################################################"
        #print repr(request)
        #print "################################################################"

More like this

  1. Print Exceptions to the Console by ericflo 2 years, 10 months ago
  2. SQL Log To Console Middleware by davepeck 2 years, 9 months ago
  3. Output sql_queries in Firebug console when in debug mode by wojas 2 years, 2 months ago
  4. Super User Conditional Page Exception Reporting by zbyte64 3 years, 9 months ago
  5. SQL Printing Middleware by ericflo 4 years, 11 months ago

Comments

(Forgotten your password?)