[Zope-Checkins] CVS: Zope/lib/python/Zope/Startup/tests - testStarter.py:1.13

Fred L. Drake, Jr. fred at zope.com
Fri Apr 9 17:22:28 EDT 2004


Update of /cvs-repository/Zope/lib/python/Zope/Startup/tests
In directory cvs.zope.org:/tmp/cvs-serv28631/Zope/Startup/tests

Modified Files:
	testStarter.py 
Log Message:
Change the mapping from zLOG to the logging package:
- don't dump everything into the "event" logger;
  use the subsystem argument to zLOG.LOG to get a specific logger
- move some comments into docstrings


=== Zope/lib/python/Zope/Startup/tests/testStarter.py 1.12 => 1.13 ===
--- Zope/lib/python/Zope/Startup/tests/testStarter.py:1.12	Fri Jan 30 14:17:53 2004
+++ Zope/lib/python/Zope/Startup/tests/testStarter.py	Fri Apr  9 17:21:57 2004
@@ -126,12 +126,11 @@
 
         # startup handler should take on the level of the event log handler
         # with the lowest level
+        logger = logging.getLogger()
         self.assertEqual(starter.startup_handler.level, 15) # 15 is BLATHER
-        self.assertEqual(starter.startup_handler,
-                     zLOG.EventLogger.EventLogger.logger.handlers[0])
-        self.assertEqual(zLOG.EventLogger.EventLogger.logger.level,
-                         15)
-        self.assertEqual(len(zLOG.EventLogger.EventLogger.logger.handlers), 1)
+        self.assertEqual(starter.startup_handler, logger.handlers[0])
+        self.assertEqual(logger.level, 15)
+        self.assertEqual(len(logger.handlers), 1)
         self.failUnlessEqual(starter.startup_handler.stream, sys.stderr)
         conf = self.load_config_text("""
             instancehome <<INSTANCE_HOME>>
@@ -276,8 +275,8 @@
             starter.info('hello')
             starter.removeStartupHandler()
             starter.setupConfiguredLoggers()
-            self.assertEqual(zLOG.EventLogger.EventLogger.logger.level,
-                             logging.INFO)
+            logger = logging.getLogger()
+            self.assertEqual(logger.level, logging.INFO)
             starter.flushStartupHandlerBuffer()
             l = open(os.path.join(TEMPNAME, 'event.log')).read()
             self.failUnless(l.find('hello') > -1)




More information about the Zope-Checkins mailing list