[Zope3-checkins] CVS: Zope3 - z3.py:1.11

Guido van Rossum guido@python.org
Thu, 19 Dec 2002 16:06:43 -0500


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

Modified Files:
	z3.py 
Log Message:
Initialize the logging module, from log.ini if it exists.


=== Zope3/z3.py 1.10 => 1.11 ===
--- Zope3/z3.py:1.10	Tue Nov 26 10:09:59 2002
+++ Zope3/z3.py	Thu Dec 19 16:06:42 2002
@@ -39,6 +39,14 @@
     libpython = os.path.join(here, 'lib', 'python') 
     sys.path = [libpython, here] + basepath
 
+    # Initialize the logging module.
+    import logging.config
+    logging.basicConfig()
+    logging.root.setLevel(logging.CRITICAL)
+    # If log.ini exists, use it
+    if os.path.exists("log.ini"):
+        logging.config.fileConfig("log.ini")
+
     # temp hack
     dir = os.getcwd()