title: python - Which is the better way to enable/disable logging?
body: <p>Which is better way to enable/disable logging?</p>
  
  <p>1) Changing log levels,</p>
  
  <pre><code>logging.disable(logging.CRITICAL)
  </code></pre>
  
  <p>2)</p>
  
  <pre><code>log = None
  </code></pre>
  
  <p>And logging messages this way,</p>
  
  <pre><code>if log:
      log.info("log message")
  </code></pre>
  
  <p>So that we can avoid unnecessary string constructions in case of logging disabled...</p>