'''Slight wrapper around flask to fit the diesel
mold.
'''
from flask import * # we're essentially republishing

from app import Application, Service
from logmod import Logger, LOGLVL_DEBUG

class DieselFlask(Flask):
    def __init__(self, name, *args, **kw):
        self.diesel_app = self.make_application()
        Flask.__init__(self, name, *args, **kw)
        self._logger = self.make_logger()
        self._logger.name = self.logger_name

    @classmethod
    def make_application(cls):
        return Application()

    def make_logger(self):
        return self.diesel_app.logger.sublog('web+' + self.logger_name)

    def run(self, port=8080, iface='', verbosity=LOGLVL_DEBUG, debug=True):
        if debug:
            self.debug = True
            from werkzeug.debug import DebuggedApplication
            self.wsgi_app = DebuggedApplication(self.wsgi_app, False)

        self.logger.verbosity = LOGLVL_DEBUG

        from diesel.protocols.wsgi import WSGIRequestHandler
        from diesel.protocols.http import HttpServer
        http_service = Service(HttpServer(WSGIRequestHandler(self.wsgi_app, port)), port, iface)
        self.diesel_app.add_service(http_service)
        self.diesel_app.run()

@@ -52,16 +52,34 @@
 ld.%0A'''%0A
+import traceback%0A%0A
 from fla
@@ -631,24 +631,546 @@
 gger_name)%0A%0A
+    def log_exception(self, exc_info):%0A        %22%22%22A replacement for Flask's default.%0A%0A        The default passed an exc_info parameter to logger.error(), which%0A        diesel doesn't support.%0A%0A        %22%22%22%0A        self.logger.error('Exception on %25s %5B%25s%5D' %25 (%0A            request.path,%0A            request.method%0A        ))%0A        if exc_info and isinstance(exc_info, tuple):%0A            self.logger.error(traceback.format_exception(*exc_info))%0A        elif exc_info:%0A            self.logger.error(traceback.format_exc())%0A%0A
     def run(

Fix for DieselFlask exception handling.