[Zope-Checkins] SVN: Zope/branches/2.9/lib/python/ZServer/utils.py Replaced zLOG with logging to shut up a deprecation warning.

Stefan H. Holek stefan at epy.co.at
Mon Aug 28 14:16:50 EDT 2006


Log message for revision 69812:
  Replaced zLOG with logging to shut up a deprecation warning.
  

Changed:
  U   Zope/branches/2.9/lib/python/ZServer/utils.py

-=-
Modified: Zope/branches/2.9/lib/python/ZServer/utils.py
===================================================================
--- Zope/branches/2.9/lib/python/ZServer/utils.py	2006-08-28 16:45:26 UTC (rev 69811)
+++ Zope/branches/2.9/lib/python/ZServer/utils.py	2006-08-28 18:16:49 UTC (rev 69812)
@@ -18,19 +18,18 @@
     return App.version_txt.version_txt()
 
 def patchAsyncoreLogger():
-    # Poke zLOG default logging into asyncore to send
-    # messages to zLOG instead of medusa logger
-    from zLOG import LOG, register_subsystem, BLATHER, INFO, WARNING, ERROR
-    register_subsystem('ZServer')
-    severity={'info':INFO, 'warning':WARNING, 'error': ERROR}
+    # Poke the Python logging module into asyncore to send
+    # messages to logging instead of medusa logger
+    from logging import getLogger
+    logger = getLogger('ZServer')
 
     def log_info(self, message, type='info'):
         if message[:14]=='adding channel' or \
            message[:15]=='closing channel' or \
            message == 'Computing default hostname':
-            LOG('ZServer', BLATHER, message)
+            logger.debug(message)
         else:
-            LOG('ZServer', severity[type], message)
+            getattr(logger, type)(message)
 
     import asyncore
     asyncore.dispatcher.log_info=log_info



More information about the Zope-Checkins mailing list