[Zope3-checkins] CVS: Zope3 - log.ini:1.6 test.py:1.64

Jeremy Hylton jeremy@zope.com
Tue, 24 Jun 2003 15:27:29 -0400


Update of /cvs-repository/Zope3
In directory cvs.zope.org:/tmp/cvs-serv28115

Modified Files:
	test.py 
Added Files:
	log.ini 
Log Message:
Restore the log.ini added last week and use it from test.py.

The log.ini was also used by z3.py to configure logging.  It was just
a bug that test.py didn't try to load it.


=== Zope3/log.ini 1.5 => 1.6 ===
--- /dev/null	Tue Jun 24 15:27:29 2003
+++ Zope3/log.ini	Tue Jun 24 15:27:28 2003
@@ -0,0 +1,33 @@
+# This file configures the logging module: critical errors are logged
+# to z3.log; everything else is ignored.
+
+# To use this configuration, use logging.config.fileConfig("log.ini").
+
+# Documentation for the file format is at
+# http://www.red-dove.com/python_logging.html#config
+
+[logger_root]
+level=CRITICAL
+handlers=normal
+
+[handler_normal]
+class=FileHandler
+level=NOTSET
+formatter=common
+args=('z3.log', 'a')
+filename=z3.log
+mode=a
+
+[formatter_common]
+format=------
+       %(asctime)s %(levelname)s %(name)s %(message)s
+datefmt=%Y-%m-%dT%H:%M:%S
+
+[loggers]
+keys=root
+
+[handlers]
+keys=normal
+
+[formatters]
+keys=common


=== Zope3/test.py 1.63 => 1.64 ===
--- Zope3/test.py:1.63	Tue Jun 24 05:00:49 2003
+++ Zope3/test.py	Tue Jun 24 15:27:28 2003
@@ -583,24 +583,21 @@
     if not keepStaleBytecode:
         os.path.walk(os.curdir, remove_stale_bytecode, None)
 
-    
-    global pathinit
-
-
-
     # Get the log.ini file from the current directory instead of possibly
     # buried in the build directory.  XXX This isn't perfect because if
     # log.ini specifies a log file, it'll be relative to the build directory.
     # Hmm...
-    logini = os.path.abspath('log.ini')
+    logini = os.path.abspath("log.ini")
 
     # Initialize the path and cwd
+    global pathinit
     pathinit = PathInit(build, build_inplace, libdir)
 
-
     # Initialize the logging module.
+    
     import logging.config
     logging.basicConfig()
+        
     level = os.getenv("LOGGING")
     if level:
         level = int(level)
@@ -608,6 +605,9 @@
         level = logging.CRITICAL
     logging.root.setLevel(level)
 
+    if os.path.exists(logini):
+        logging.config.fileConfig(logini)
+        
     files = find_tests(module_filter)
     files.sort()