title: PyDev unittesting: How to capture text logged to a logging.Logger in "Captured Output"
body: <p>I am using PyDev for development and unit-testing of my Python application.
  As for unit-testing, everything works great except the fact that no content is logged to the logging framework. The logger is not captured by the "Captured output" of PyDev.</p>
  
  <p>I'm already forwarding everything logged to the standard output like this:</p>
  
  <pre class="lang-py prettyprint-override"><code>import sys
  logger = logging.getLogger()
  logger.level = logging.DEBUG
  logger.addHandler(logging.StreamHandler(sys.stdout))
  </code></pre>
  
  <p>Nevertheless the "Captured output" does not display the stuff logged to loggers.</p>
  
  <p>Here's an example unittest-script: <em>test.py</em>
  </p>
  
  <pre><code>import sys
  import unittest
  import logging
  
  logger = logging.getLogger()
  logger.level = logging.DEBUG
  logger.addHandler(logging.StreamHandler(sys.stdout))
  
  class TestCase(unittest.TestCase):
      def testSimpleMsg(self):
          print("AA")
          logging.getLogger().info("BB")
  </code></pre>
  
  <p>The console output is:</p>
  
  <pre><code>Finding files... done.
  Importing test modules ... done.
  
  testSimpleMsg (itf.lowlevel.tests.hl7.TestCase) ... AA
  2011-09-19 16:48:00,755 - root - INFO - BB
  BB
  ok
  
  ----------------------------------------------------------------------
  Ran 1 test in 0.001s
  
  OK
  </code></pre>
  
  <p>But the <strong>CAPTURED OUTPUT</strong> for the test is:</p>
  
  <pre><code>======================== CAPTURED OUTPUT =========================
  AA
  </code></pre>
  
  <p>Does anybody know how to capture everything that is logged to a <code>logging.Logger</code> during the execution of this test?</p>