[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/StartUp - SiteDefinition.py:1.10

Guido van Rossum guido@python.org
Thu, 19 Dec 2002 18:05:53 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/StartUp
In directory cvs.zope.org:/tmp/cvs-serv16444

Modified Files:
	SiteDefinition.py 
Log Message:
Convert to logging module.

=== Zope3/lib/python/Zope/App/StartUp/SiteDefinition.py 1.9 => 1.10 ===
--- Zope3/lib/python/Zope/App/StartUp/SiteDefinition.py:1.9	Thu Dec 19 17:40:12 2002
+++ Zope3/lib/python/Zope/App/StartUp/SiteDefinition.py	Thu Dec 19 18:05:22 2002
@@ -18,6 +18,8 @@
 """
 
 import sys
+import logging
+import asyncore
 
 # Import Configuration-related classes
 from Zope.Configuration.Action import Action
@@ -36,8 +38,6 @@
 
 from Persistence.Module import PersistentModuleImporter
 
-import asyncore, zLOG
-
 DEFAULT_STORAGE_FILE = 'Data.fs'
 DEFAULT_LOG_FILE = 'STDERR'
 DEFAULT_LOG_CLASS = 'Zope.Server.HTTPServer.CommonHitLogger'
@@ -84,10 +84,10 @@
 
         if file in self._special_log_files.keys():
             file = self._special_log_files[file]
+            handler = logging.StreamHandler(file)
         else:
-            file = open(file, 'a')
-
-        zLOG._set_log_dest(file)
+            handler = logging.FileHandler(file)
+        logging.root.addHandler(handler)
         return []