[Zodb-checkins] CVS: ZODB4 - test.py:1.12

Jeremy Hylton jeremy@zope.com
Thu, 19 Dec 2002 17:50:14 -0500


Update of /cvs-repository/ZODB4
In directory cvs.zope.org:/tmp/cvs-serv14282

Modified Files:
	test.py 
Log Message:
Copy logging initialization from Zope3


=== ZODB4/test.py 1.11 => 1.12 ===
--- ZODB4/test.py:1.11	Mon Dec 16 15:58:26 2002
+++ ZODB4/test.py	Thu Dec 19 17:50:13 2002
@@ -352,6 +352,15 @@
 def main(module_filter, test_filter):
     os.path.walk(os.curdir, remove_stale_bytecode, None)
     setup_path()
+    
+    # Initialize the logging module.
+    import logging.config
+    logging.basicConfig()
+    logging.root.setLevel(logging.CRITICAL)
+    # If log.ini exists, use it
+    if os.path.exists("log.ini"):
+        logging.config.fileConfig("log.ini")
+
     finder = find_tests(module_filter)
     files = finder.files
     files.sort()