title: python: Injecting a middle man to method calls
body: <p>I would like to listen in on some calls to 3rd party library methods. Notably, I'd like to attach some sort of feedback method on these methods I am listening to. For instance, whenever logging.info(msg, *args, **kwargs) is called, I'd like to have a separate method with same parameter list fired off as well.</p>
  
  <p>The closest I can find is the <a href="https://docs.python.org/3/library/unittest.mock.html" rel="nofollow">mock module</a>'s side_effect feature. But correct me if I am wrong, this feature will completely override the original behaviour of the function instead of tagging a function along.</p>
  
  <p>Is there a module out there that can suit my needs or do I have to unceremonously hijack the functions I need?</p>
  
  <p>Edit: Clarified title. </p>