[Zope-Checkins] SVN: Zope/trunk/lib/python/AccessControl/ zLOG -> logging

Andreas Jung andreas at andreas-jung.com
Sun Jan 8 05:57:25 EST 2006


Log message for revision 41201:
  zLOG -> logging

Changed:
  U   Zope/trunk/lib/python/AccessControl/ImplPython.py
  U   Zope/trunk/lib/python/AccessControl/SecurityInfo.py

-=-
Modified: Zope/trunk/lib/python/AccessControl/ImplPython.py
===================================================================
--- Zope/trunk/lib/python/AccessControl/ImplPython.py	2006-01-08 10:52:53 UTC (rev 41200)
+++ Zope/trunk/lib/python/AccessControl/ImplPython.py	2006-01-08 10:57:25 UTC (rev 41201)
@@ -15,13 +15,13 @@
 
 import os
 import string
+from logging import getLogger
 
 from Acquisition import aq_base
 from Acquisition import aq_parent
 from Acquisition import aq_inner
 from Acquisition import aq_acquire
 from ExtensionClass import Base
-from zLOG import LOG, BLATHER, PROBLEM
 from zope.interface import implements
 
 # This is used when a permission maps explicitly to no permission.  We
@@ -39,6 +39,7 @@
 from AccessControl.SimpleObjectPolicies import Containers, _noroles
 from AccessControl.ZopeGuards import guarded_getitem
 
+LOG = getLogger('ImplPython')
 
 # AccessControl.PermissionRole
 # ----------------------------
@@ -346,7 +347,7 @@
                 return 1
         except TypeError:
             # 'roles' isn't a sequence
-            LOG('Zope Security Policy', PROBLEM, "'%s' passed as roles"
+            LOG.error("'%s' passed as roles"
                 " during validation of '%s' is not a sequence." % (
                 `roles`, name))
             raise
@@ -804,7 +805,7 @@
         info.append(s + '.')
 
     text = ' '.join(info)
-    LOG('Zope Security Policy', BLATHER, 'Unauthorized: %s' % text)
+    LOG.debug('Unauthorized: %s' % text)
     raise Unauthorized(text)
 
 def getUserRolesInContext(user, context):

Modified: Zope/trunk/lib/python/AccessControl/SecurityInfo.py
===================================================================
--- Zope/trunk/lib/python/AccessControl/SecurityInfo.py	2006-01-08 10:52:53 UTC (rev 41200)
+++ Zope/trunk/lib/python/AccessControl/SecurityInfo.py	2006-01-08 10:57:25 UTC (rev 41201)
@@ -39,13 +39,15 @@
 """
 
 import sys
+from logging import getLogger
 
 import Acquisition
 
 from AccessControl.ImplPython import _what_not_even_god_should_do
-from zLOG import LOG, WARNING
 
+LOG = getLogger('SecurityInfo')
 
+
 # Security constants - these are imported into the AccessControl
 # namespace and can be referenced as AccessControl.PUBLIC etc.
 
@@ -69,8 +71,7 @@
     def _setaccess(self, names, access):
         for name in names:
             if self.names.get(name, access) != access:
-                LOG('SecurityInfo', WARNING, 'Conflicting security '
-                    'declarations for "%s"' % name)
+                LOG.warn('Conflicting security declarations for "%s"' % name)
                 self._warnings = 1
             self.names[name] = access
 
@@ -111,7 +112,7 @@
         for role in roles:
             rdict[role] = 1
         if self.roles.get(permission_name, rdict) != rdict:
-            LOG('SecurityInfo', WARNING, 'Conflicting default role'
+            LOG.warn('Conflicting default role'
                 'declarations for permission "%s"' % permission_name)
             self._warnings = 1
         self.roles[permission_name] = rdict
@@ -193,7 +194,7 @@
                     access)
 
         if getattr(self, '_warnings', None):
-            LOG('SecurityInfo', WARNING, 'Class "%s" had conflicting '
+            LOG.warn('Class "%s" had conflicting '
                 'security declarations' % classobj.__name__)
 
 class ClassSecurityInformation(ClassSecurityInfo):
@@ -273,7 +274,7 @@
             dict['__allow_access_to_unprotected_subobjects__'] = self
 
         if getattr(self, '_warnings', None):
-            LOG('SecurityInfo', WARNING, 'Module "%s" had conflicting '
+            LOG.warn('Module "%s" had conflicting '
                 'security declarations' % dict['__name__'])
 
     declareProtected__roles__=ACCESS_PRIVATE



More information about the Zope-Checkins mailing list