[Zodb-checkins] CVS: Zope/lib/python/ZEO - start.py:1.53

Chris McDonough chrism@zope.com
Sun, 24 Nov 2002 00:25:19 -0500


Update of /cvs-repository/Zope/lib/python/ZEO
In directory cvs.zope.org:/tmp/cvs-serv18755/ZEO

Modified Files:
	start.py 
Log Message:
Changes to support PEP 282-based logger instead of minimal logger.


=== Zope/lib/python/ZEO/start.py 1.52 => 1.53 ===
--- Zope/lib/python/ZEO/start.py:1.52	Mon Nov 18 18:17:41 2002
+++ Zope/lib/python/ZEO/start.py	Sun Nov 24 00:25:18 2002
@@ -95,6 +95,8 @@
 def main(argv):
     me = argv[0]
     sys.path.insert(0, directory(me, 2))
+    import zLOG
+    zLOG.initialize()
 
     global LOG, INFO, ERROR
     from zLOG import LOG, INFO, WARNING, ERROR, PANIC
@@ -203,7 +205,7 @@
     if args:
         if len(args) > 1:
             print usage
-            print 'Unrecognizd arguments: ', " ".join(args[1:])
+            print 'Unrecognized arguments: ', " ".join(args[1:])
             sys.exit(1)
         fs = args[0]
 
@@ -211,6 +213,7 @@
         os.environ['Z_DEBUG_MODE'] = '1'
     if detailed:
         os.environ['STUPID_LOG_SEVERITY'] = '-300'
+        zLOG.initialize()
 
     set_uid(UID)
 
@@ -308,17 +311,18 @@
 
 def rotate_logs():
     import zLOG
-    # There hasn't been a clear way to reinitialize the MinimalLogger.
-    # I'll checkin the public initialize() method soon, but also try some
-    # other strategies for older Zope installs :-(.
     init = getattr(zLOG, 'initialize', None)
     if init is not None:
         init()
         return
     # This will work if the minimal logger is in use, but not if some
-    # other logger is active.
-    import zLOG.MinimalLogger
-    zLOG.MinimalLogger._log.initialize()
+    # other logger is active.  MinimalLogger exists only in Zopes
+    # pre-2.7.
+    try:
+        import zLOG.MinimalLogger
+        zLOG.MinimalLogger._log.initialize()
+    except ImportError:
+        pass
 
 def rotate_logs_handler(signum, frame):
     rotate_logs()