~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to serve-branches

  • Committer: Paul Hummer
  • Date: 2008-10-25 22:30:55 UTC
  • mto: This revision was merged to the branch mainline in revision 239.
  • Revision ID: paul@ubuntu.com-20081025223055-c2cbypybmj5yoxjo
Added profile flag for profiling loggerhead

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
                      help="Host Loggerhead should listen on.")
51
51
    parser.add_option("--prefix", dest="user_prefix",
52
52
                      help="Specify host prefix.")
 
53
    parser.add_option("--profile", action="store_true", dest="profile",
 
54
                      help="Adds profiling information to the HTML of "
 
55
                      "each request.")
53
56
    parser.add_option("--reload", action="store_true", dest="reload",
54
57
                      help="Restarts the application when changing python"
55
58
                           " files. Only used for development purposes.")
116
119
    app = ErrorHandlerApp(app)
117
120
    app = HTTPExceptionHandler(app)
118
121
    app = TransLogger(app, logger=logger)
 
122
    if options.profile:
 
123
        from paste.debug.profile import ProfileMiddleware
 
124
        app = ProfileMiddleware(app)
119
125
 
120
126
    if not options.user_prefix:
121
127
        prefix = '/'