[portland] lightning talk link: Test Logger

Adam Lowry adam at therobots.org
Wed May 12 20:04:08 CEST 2010


Thanks, Jeff -- it's a very cool idea.

Someone mentioned that I talked *extremely* fast last night when I demoed repoze.profile, so I thought I'd send along links:

http://pypi.python.org/pypi/repoze.profile

And here's how I added it as middleware to a wsgi app:

    from repoze.profile.profiler import AccumulatingProfileMiddleware
    app = make_app()
    return AccumulatingProfileMiddleware(
        app,
        log_filename='werkprof.log',
        cachegrind_filename='cachegrind.out.bar',
        discard_first_request=True,
        flush_at_shutdown=True,
        path='/__profile__'
    )
    app = repoze.profile.ProfilingMiddleware(app)

And after that the profile GUI is on the same server, running at /__profile__ (the middleware hijacks this path).

Adam

On May 12, 2010, at 10:30 AM, Jeff Schwaber wrote:

> Hey,
> 
> Somebody asked for a link to the code I showed last night, so here it is.
> 
> http://github.com/freyley/pytestlogger
> 
> I haven't maintained it, but I will if anyone says "hey, I want to use
> that." So send me an email if you want. =)
> 
> Thanks,
> 
> Jeff
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mail.python.org/pipermail/portland/attachments/20100512/447d9639/attachment.html>
> _______________________________________________
> Portland mailing list
> Portland at python.org
> http://mail.python.org/mailman/listinfo/portland



More information about the Portland mailing list