ENH: keep spitting out logging to the screen in LogCaptureTestCases if HEAVYDEBUG

_tent/cache-config-read
Yaroslav Halchenko 2014-10-09 10:46:17 -04:00
parent f31607ded1
commit 0c5f11079c
1 changed files with 3 additions and 0 deletions

View File

@ -25,6 +25,7 @@ __license__ = "GPL"
import logging import logging
import os import os
import re import re
import sys
import time import time
import unittest import unittest
from StringIO import StringIO from StringIO import StringIO
@ -205,6 +206,8 @@ class LogCaptureTestCase(unittest.TestCase):
# Let's log everything into a string # Let's log everything into a string
self._log = StringIO() self._log = StringIO()
logSys.handlers = [logging.StreamHandler(self._log)] logSys.handlers = [logging.StreamHandler(self._log)]
if self._old_level < logging.DEBUG: # so if HEAVYDEBUG etc -- show them!
logSys.handlers += self._old_handlers
logSys.setLevel(getattr(logging, 'DEBUG')) logSys.setLevel(getattr(logging, 'DEBUG'))
def tearDown(self): def tearDown(self):