SVN: ZODB/trunk/src/ZEO/tests/testConnection.py Fixed a bug in the debug logging.

Jim Fulton <[email protected]>
Newsgroups gmane.comp.python.zope.zodb.cvs
Message-ID <20100917182624.0928C941C0__36702.9287423522$1284747989$gmane$org@cvs.zope.org>
Log message for revision 116541:
  Fixed a bug in the debug logging.
  

Changed:
  U   ZODB/trunk/src/ZEO/tests/testConnection.py

-=-
Modified: ZODB/trunk/src/ZEO/tests/testConnection.py
===================================================================
--- ZODB/trunk/src/ZEO/tests/testConnection.py	2010-09-17 18:24:11 UTC (rev 116540)
+++ ZODB/trunk/src/ZEO/tests/testConnection.py	2010-09-17 18:26:23 UTC (rev 116541)
@@ -170,7 +170,7 @@
   constantly,
 
     >>> import zope.testing.loggingsupport, logging
-    >>> debughandler = zope.testing.loggingsupport.InstalledHandler(
+    >>> handler = zope.testing.loggingsupport.InstalledHandler(
     ...    'ZEO', level=logging.DEBUG)
 
     >>> import random, threading, time
@@ -199,9 +199,6 @@
 - restarting the first client, and
 - testing for cache validity.
 
-    >>> handler = zope.testing.loggingsupport.InstalledHandler(
-    ...    'ZEO', level=logging.ERROR)
-
     >>> bad = False
     >>> try:
     ...     for c in range(10):
@@ -223,10 +220,10 @@
     ...                    bad = True
     ...        if bad:
     ...           print open('server-%s.log' % addr[1]).read()
-    ...           print 'client debug log'
-    ...           for record in debughandler.records:
+    ...           print 'client debug log', handler
+    ...           for record in handler.records:
     ...               print record.name, record.levelname
-    ...               print debughandler.format(record)
+    ...               print handler.format(record)
     ...        else:
     ...           logging.getLogger('ZEO').debug('GOOD %s' % c)
     ...        db.close()
@@ -234,18 +231,12 @@
     ...     stop = True
     ...     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()
     False
 
     >>> for record in handler.records:
+    ...     if record.levelno < logging.ERROR:
+    ...         continue
     ...     print record.name, record.levelname
     ...     print handler.format(record)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.