WSGI Application Profiler

Warning

werkzeug.contrib.profiler has moved towerkzeug.middleware.profiler. The old import is deprecated asof 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:
  1. f = open('profiler.log', 'w')
  2. stream = MergeStream(sys.stdout, f)
  3. profiler = ProfilerMiddleware(app, stream)

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