title: Python, logging and design
body: <p>I have frequent doubts when I write python modules and classes, specifically: </p>
  
  <p>Where/how should I put the main flag that controls logging and where/how to create the logger,</p>
  
  <ul>
  <li><p>Should it be at the module level? ---thus need to have some <code>global MyLogger</code> almost everywhere inside each method.</p></li>
  <li><p>Should it be an argument passed to methods and/or classes? Perhaps to decide if a method or class needed it or not, maybe I could use the <code>**args</code> stars magic, with call like <code>myMethod(..., logger=Mylogger)</code>?</p></li>
  <li><p>Where should I define/set the <code>I_logged_something</code> flag? (...or should I rely on the <code>if MyLogger: MyLogger.log('something')</code>)</p></li>
  <li><p>What about when the class or module is imported?</p></li>
  </ul>
  
  <p>What is the Pythonic way of logging? How do you use the logging tools?</p>