Intercept method calls in Python

Posted by eaigner on Stack Overflow See other posts from Stack Overflow or by eaigner
Published on 2010-04-24T12:22:15Z Indexed on 2010/04/24 12:33 UTC
Read the original article Hit count: 317

Filed under:

Hi.

I'm implementing a RESTful web service in python and would like to add some QOS logging functionality by intercepting function calls and logging their execution time and so on.

Basically i thought of a class from which all other services can inherit, that automatically overrides the default method implementations and wraps them in a logger function. What's the best way to achieve this?

© Stack Overflow or respective owner

Related posts about python