title: Get all logging output with mock
body: <p>I want to get all logging output with mock. I searched, but
  only found ways to mock explicitly logging.info or logging.warn.</p>
  
  <p>I need all output, whatever logging level was set. </p>
  
  <pre><code>def test_foo():
  
     def my_log(...):
        logs.append(...)
  
     with mock.patch('logging.???', my_log):
          ...
  </code></pre>
  
  <p>In our libraries we use this:</p>
  
  <pre><code>import logging
  logger=logging.getLogger(__name__)
  
  def foo():
      logger.info(...)
  </code></pre>