[Zodb-checkins] SVN: ZODB/branches/3.4/ - The changeover from zLOG to the logging module means that some

Jens Vagelpohl jens at dataflake.org
Sat Dec 10 14:04:34 EST 2005


Log message for revision 40679:
  - The changeover from zLOG to the logging module means that some
    tools need to perform minimal logging configuration themselves. Changed
    the zeoup script to do so and thus enable it to emit error messages.
  
  

Changed:
  U   ZODB/branches/3.4/NEWS.txt
  U   ZODB/branches/3.4/src/scripts/zeoup.py

-=-
Modified: ZODB/branches/3.4/NEWS.txt
===================================================================
--- ZODB/branches/3.4/NEWS.txt	2005-12-10 17:47:53 UTC (rev 40678)
+++ ZODB/branches/3.4/NEWS.txt	2005-12-10 19:04:33 UTC (rev 40679)
@@ -13,7 +13,14 @@
 - (3.4.3b1) The ``PersistentMapping`` makes changes by a ``pop()`` method call
   persistent now.
 
+Tools
+-----
 
+- (3.4.3b1) The changeover from zLOG to the logging module means that some
+  tools need to perform minimal logging configuration themselves. Changed
+  the zeoup script to do so and thus enable it to emit error messages.
+
+
 What's new in ZODB3 3.4.2?
 ==========================
 Release date: 12-Oct-2005

Modified: ZODB/branches/3.4/src/scripts/zeoup.py
===================================================================
--- ZODB/branches/3.4/src/scripts/zeoup.py	2005-12-10 17:47:53 UTC (rev 40678)
+++ ZODB/branches/3.4/src/scripts/zeoup.py	2005-12-10 19:04:33 UTC (rev 40679)
@@ -27,6 +27,7 @@
 """
 
 import getopt
+import logging
 import socket
 import sys
 import time
@@ -41,6 +42,18 @@
 
 ZEO_VERSION = 2
 
+def setup_logging():
+    # Set up logging to stderr which will show messages originating
+    # at severity ERROR or higher.
+    root = logging.getLogger()
+    root.setLevel(logging.ERROR)
+    fmt = logging.Formatter(
+        "------\n%(asctime)s %(levelname)s %(name)s %(message)s",
+        "%Y-%m-%dT%H:%M:%S")
+    handler = logging.StreamHandler()
+    handler.setFormatter(fmt)
+    root.addHandler(handler)
+
 def check_server(addr, storage, write):
     t0 = time.time()
     if ZEO_VERSION == 2:
@@ -122,6 +135,7 @@
             usage()
         addr = host, port
 
+    setup_logging()
     check_server(addr, storage, write)
 
 if __name__ == "__main__":



More information about the Zodb-checkins mailing list