SVN: PluggableAuthService/trunk/Extensions/upgrade.py - move to logging module

Jens Vagelpohl <[email protected]> Sat, 25 Feb 2006 15:01:13 -0500 (EST)
Newsgroups gmane.comp.web.zope.public-cvs
Message-ID <[email protected]>
Log message for revision 65465:
  - move to logging module
  - Stop deprecation warnings by inserting Zope 2.7-backwards-compatible
    code to define get_transaction
  

Changed:
  U   PluggableAuthService/trunk/Extensions/upgrade.py

-=-
Modified: PluggableAuthService/trunk/Extensions/upgrade.py
===================================================================
--- PluggableAuthService/trunk/Extensions/upgrade.py	2006-02-25 19:58:27 UTC (rev 65464)
+++ PluggableAuthService/trunk/Extensions/upgrade.py	2006-02-25 20:01:13 UTC (rev 65465)
@@ -30,13 +30,20 @@
 
 $Id$
 """
-from zLOG import LOG, INFO
+import logging
 
-def _write( response, tool, message, level=INFO ):
+try:
+    import transaction
+    get_transaction = transaction.get
+except ImportError:
+    # Zope 2.7 backwards compatibility
+    pass
 
-    LOG( tool, level, message )
+def _write(response, tool, message):
+    logger = logging.getLogger('PluggableAuthService.upgrade.%s' % tool)
+    logger.info(message)
     if response is not None:
-        response.write( message )
+        response.write(message)
 
 def _replaceUserFolder(self, RESPONSE=None):
     """replaces the old acl_users folder with a PluggableAuthService,

_______________________________________________
Zope-CVS maillist  -  [email protected]
http://mail.zope.org/mailman/listinfo/zope-cvs

Zope CVS instructions: http://dev.zope.org/CVS