[Zope-CVS] SVN: PluggableAuthService/trunk/Extensions/upgrade.py -
move to logging module
Jens Vagelpohl
jens at dataflake.org
Sat Feb 25 15:01:13 EST 2006
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,
More information about the Zope-CVS
mailing list