enabled rotate_handler output.

svn: r5674
This commit is contained in:
Richard Taylor
2006-01-05 19:07:27 +00:00
parent ce52de5804
commit cfb8cc47a4
5 changed files with 83 additions and 12 deletions

View File

@ -12,29 +12,35 @@ logger = logging.getLogger('Gramps.Tests.GrampsLogger')
import const
const.rootDir = "../../src"
import _GtkHandler
from GrampsLogger import GtkHandler, RotateHandler
class GtkHandlerTest(unittest.TestCase):
"""Test the GtkHandler."""
def test_window(self):
"""Test that the window appears."""
rh = _GtkHandler.GtkHandler()
l = logging.getLogger("GtkHandlerTest")
l.setLevel(logging.ERROR)
l.addHandler(rh)
rh = RotateHandler(capacity=20)
rh.setLevel(logging.DEBUG)
gtkh = GtkHandler(rotate_handler=rh)
gtkh.setLevel(logging.ERROR)
l = logging.getLogger("GtkHandlerTest")
l.setLevel(logging.DEBUG)
l.addHandler(rh)
l.addHandler(gtkh)
l.info("An info message")
l.warn("A warn message")
l.debug("A debug message")
log_message = "Debug message"
try:
wibble
except:
l.error(log_message,exc_info=True)
l.removeHandler(rh)
gtk.main()