# HG changeset patch # User Marcin Kuzminski # Date 2011-06-03 11:45:10 # Node ID bfc529377cdc60329f7a3249417a9e049b6aec1c # Parent ed309b1fbaa420bdd96902f32d05a2baadd753e8 added simple profiling middleware controlled by .ini file flag diff --git a/development.ini b/development.ini --- a/development.ini +++ b/development.ini @@ -7,6 +7,7 @@ [DEFAULT] debug = true +pdebug = false ################################################################################ ## Uncomment and replace with the address which should receive ## ## any error reports after application crash ## diff --git a/production.ini b/production.ini --- a/production.ini +++ b/production.ini @@ -7,6 +7,7 @@ [DEFAULT] debug = true +pdebug = false ################################################################################ ## Uncomment and replace with the address which should receive ## ## any error reports after application crash ## diff --git a/rhodecode/config/deployment.ini_tmpl b/rhodecode/config/deployment.ini_tmpl --- a/rhodecode/config/deployment.ini_tmpl +++ b/rhodecode/config/deployment.ini_tmpl @@ -7,6 +7,7 @@ [DEFAULT] debug = true +pdebug = false ################################################################################ ## Uncomment and replace with the address which should receive ## ## any error reports after application crash ## diff --git a/rhodecode/config/middleware.py b/rhodecode/config/middleware.py --- a/rhodecode/config/middleware.py +++ b/rhodecode/config/middleware.py @@ -47,6 +47,9 @@ def make_app(global_conf, full_stack=Tru app = SessionMiddleware(app, config) # CUSTOM MIDDLEWARE HERE (filtered by error handling middlewares) + if asbool(config['pdebug']): + from rhodecode.lib.profiler import ProfilingMiddleware + app = ProfilingMiddleware(app) app = SimpleHg(app, config) app = SimpleGit(app, config)