El 04/09/13 10:26, Ethan Furman escribió:

I would say it is not really the caller's or the callee's job to do the
logging, even though it should be done.  What would be really handy is a
function that sat in between the caller and callee that logged for you
-- you know, a decorator:

Thanks a lot! My knowledge to decorator is so limited to @staticmethod that I don't know I can write my own decorator. This is a good lesson to learn.

Your example lead me to explore and find this article which addressed the case of using decorator to log:

http://simeonfranklin.com/blog/2012/jul/1/python-decorators-in-12-steps/
(To googler who find this post: search 'log' in the above article)
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to