Commit a6fb6824 authored by Andreas Jung's avatar Andreas Jung

zLOG -> logging

parent 282104fb
......@@ -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.interfaces import ISecurityManager
from AccessControl.SimpleObjectPolicies import Containers, _noroles
from AccessControl.ZopeGuards import guarded_getitem
LOG = getLogger('ImplPython')
# AccessControl.PermissionRole
# ----------------------------
......@@ -346,7 +347,7 @@ class ZopeSecurityPolicy:
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 @@ def raiseVerbose(msg, accessed, container, name, value, context,
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):
......
......@@ -39,11 +39,13 @@
"""
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
......@@ -69,8 +71,7 @@ class SecurityInfo(Acquisition.Implicit):
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 @@ class SecurityInfo(Acquisition.Implicit):
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 @@ class ClassSecurityInfo(SecurityInfo):
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 @@ class _ModuleSecurityInfo(SecurityInfo):
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment