WSGI Application Profiler


werkzeug.contrib.profiler has moved to werkzeug.middleware.profile. The old import is deprecated as of version 0.15 and will be removed in version 1.0.

class werkzeug.contrib.profiler.MergeStream(*streams)

An object that redirects write calls to multiple streams. Use this to log to both sys.stdout and a file:

f = open('profiler.log', 'w')
stream = MergeStream(sys.stdout, f)
profiler = ProfilerMiddleware(app, stream)

Deprecated since version 0.15: Use the tee command in your terminal instead. This class will be removed in 1.0.