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. SQL Log To Console Middleware by davepeck 3 years, 9 months ago
  2. Output sql_queries in Firebug console when in debug mode by wojas 3 years, 2 months ago
  3. Print Exceptions to the Console by ericflo 3 years, 9 months ago
  4. Better debugging mail server by yourcelf 2 years, 2 months ago
  5. Interactive debugger and other Paste niceties by maxua 3 years, 8 months ago

Comments

(Forgotten your password?)