[Zope-Checkins] CVS: ZODB3/ZEO - runzeo.py:1.11

Guido van Rossum guido@python.org
Fri, 24 Jan 2003 11:35:05 -0500


Update of /cvs-repository/ZODB3/ZEO
In directory cvs.zope.org:/tmp/cvs-serv20336

Modified Files:
	runzeo.py 
Log Message:
By default, log to stderr.  This is much better than no logging by
default.


=== ZODB3/ZEO/runzeo.py 1.10 => 1.11 ===
--- ZODB3/ZEO/runzeo.py:1.10	Wed Jan 22 15:38:11 2003
+++ ZODB3/ZEO/runzeo.py	Fri Jan 24 11:35:03 2003
@@ -109,6 +109,7 @@
         self.options = options
 
     def main(self):
+        self.setup_default_logging()
         self.check_socket()
         self.clear_socket()
         try:
@@ -119,6 +120,17 @@
         finally:
             self.close_storages()
             self.clear_socket()
+
+    def setup_default_logging(self):
+        if self.options.config_logger is not None:
+            return
+        if os.getenv("EVENT_LOG_FILE") is not None:
+            return
+        if os.getenv("STUPID_LOG_FILE") is not None:
+            return
+        # No log file is configured; default to stderr.  The logging
+        # level can still be controlled by {STUPID,EVENT}_LOG_SEVERITY.
+        os.environ["EVENT_LOG_FILE"] = ""
 
     def check_socket(self):
         if self.can_connect(self.options.family, self.options.address):