[Zope-CVS] CVS: ZODB - test.py:1.6

Fred L. Drake, Jr. fred at zope.com
Fri Apr 9 19:07:47 EDT 2004


Update of /cvs-repository/ZODB
In directory cvs.zope.org:/tmp/cvs-serv15159

Modified Files:
	test.py 
Log Message:
Egads!  Logging configuration is painful, especially when two packages
think they're allowed to do it.  For now, just let zLOG initialize
everything; we can figure out the right way to make zLOG and logging
co-habitate later.


=== ZODB/test.py 1.5 => 1.6 ===
--- ZODB/test.py:1.5	Fri Apr  9 11:23:16 2004
+++ ZODB/test.py	Fri Apr  9 19:07:46 2004
@@ -603,12 +603,21 @@
     if not keepStaleBytecode:
         os.path.walk(os.curdir, remove_stale_bytecode, None)
 
-    configure_logging()
+    # Skip this; zLOG will eventually win, and coordinating
+    # initialization is a loosing battle.
+    #configure_logging()
 
     # Initialize the path and cwd
     global pathinit
     pathinit = PathInit(build, build_inplace, libdir)
 
+    # We need to make sure zLOG takes its turn at initializing the
+    # logging package before we start calling any logging methods, so
+    # we don't find that it changes at some arbitrary time in the
+    # future.
+    import zLOG
+    zLOG.initialize()
+
     files = find_tests(module_filter)
     files.sort()
 
@@ -657,6 +666,15 @@
         # spawned processes.  We haven't thought of a better way to do
         # it than using environment variables.
         os.environ["LOGINI"] = logini
+
+    # Re-write the filenames in the environment so they don't wander
+    # when specified as relative paths and we os.chdir().
+    if os.environ.has_key("STUPID_LOG_FILE"):
+        os.environ["STUPID_LOG_FILE"] = os.path.abspath(
+            os.environ["STUPID_LOG_FILE"])
+    if os.environ.has_key("EVENT_LOG_FILE"):
+        os.environ["EVENT_LOG_FILE"] = os.path.abspath(
+            os.environ["EVENT_LOG_FILE"])
 
 
 def process_args(argv=None):




More information about the Zope-CVS mailing list