Logging function calls without changing code

Rajat Sharma rajat.sharma.2 at asu.edu
Wed May 24 15:05:30 EDT 2017


Hi Everyone, 

Is there a way to log all function calls of a class without changing anything in that class.

What I mean to say is if I have written a class previously and I want to enable logging in that then I would probably need to write the following before my function calls-

logger.debug('<function name> called...')

But, is there a way that I do not need to change my existing code and can create a wrapper around that existing class or something else which can help me do the same?

Thanks.



More information about the Python-list mailing list