Commit a6b17807 authored by Jim Fulton's avatar Jim Fulton

Fixed a bug in the debug logging.

parent 63eb9350
...@@ -170,7 +170,7 @@ This tests tries to provoke this bug by: ...@@ -170,7 +170,7 @@ This tests tries to provoke this bug by:
constantly, constantly,
>>> import zope.testing.loggingsupport, logging >>> import zope.testing.loggingsupport, logging
>>> debughandler = zope.testing.loggingsupport.InstalledHandler( >>> handler = zope.testing.loggingsupport.InstalledHandler(
... 'ZEO', level=logging.DEBUG) ... 'ZEO', level=logging.DEBUG)
>>> import random, threading, time >>> import random, threading, time
...@@ -199,9 +199,6 @@ This tests tries to provoke this bug by: ...@@ -199,9 +199,6 @@ This tests tries to provoke this bug by:
- restarting the first client, and - restarting the first client, and
- testing for cache validity. - testing for cache validity.
>>> handler = zope.testing.loggingsupport.InstalledHandler(
... 'ZEO', level=logging.ERROR)
>>> bad = False >>> bad = False
>>> try: >>> try:
... for c in range(10): ... for c in range(10):
...@@ -223,10 +220,10 @@ This tests tries to provoke this bug by: ...@@ -223,10 +220,10 @@ This tests tries to provoke this bug by:
... bad = True ... bad = True
... if bad: ... if bad:
... print open('server-%s.log' % addr[1]).read() ... print open('server-%s.log' % addr[1]).read()
... print 'client debug log' ... print 'client debug log', handler
... for record in debughandler.records: ... for record in handler.records:
... print record.name, record.levelname ... print record.name, record.levelname
... print debughandler.format(record) ... print handler.format(record)
... else: ... else:
... logging.getLogger('ZEO').debug('GOOD %s' % c) ... logging.getLogger('ZEO').debug('GOOD %s' % c)
... db.close() ... db.close()
...@@ -234,18 +231,12 @@ This tests tries to provoke this bug by: ...@@ -234,18 +231,12 @@ This tests tries to provoke this bug by:
... stop = True ... stop = True
... thread.join(10) ... thread.join(10)
>>> if bad:
... print open('server-%s.log' % addr[1]).read()
... print 'client debug log'
... for record in debughandler.records:
... print record.name, record.levelname
... print debughandler.format(record)
>>> debughandler.uninstall()
>>> thread.isAlive() >>> thread.isAlive()
False False
>>> for record in handler.records: >>> for record in handler.records:
... if record.levelno < logging.ERROR:
... continue
... print record.name, record.levelname ... print record.name, record.levelname
... print handler.format(record) ... print handler.format(record)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment