Commit 6734f4b2 authored by Andreas Jung's avatar Andreas Jung

zLOG -> logging

parent 791ea4a9
...@@ -658,8 +658,7 @@ static PyExtensionClass imPermissionRoleType = { ...@@ -658,8 +658,7 @@ static PyExtensionClass imPermissionRoleType = {
static PyObject *Containers = NULL; static PyObject *Containers = NULL;
static PyObject *ContainerAssertions = NULL; static PyObject *ContainerAssertions = NULL;
static PyObject *Unauthorized = NULL; static PyObject *Unauthorized = NULL;
static PyObject *LOG = NULL; static PyObject *warn= NULL;
static PyObject *PROBLEM = NULL;
static PyObject *NoSequenceFormat = NULL; static PyObject *NoSequenceFormat = NULL;
static PyObject *_what_not_even_god_should_do = NULL; static PyObject *_what_not_even_god_should_do = NULL;
static PyObject *Anonymous = NULL; static PyObject *Anonymous = NULL;
...@@ -1052,8 +1051,7 @@ static PyObject *ZopeSecurityPolicy_validate(PyObject *self, PyObject *args) { ...@@ -1052,8 +1051,7 @@ static PyObject *ZopeSecurityPolicy_validate(PyObject *self, PyObject *args) {
m=PyObject_Repr(roles); m=PyObject_Repr(roles);
if (m) ASSIGN(m, Py_BuildValue("OO", m, name)); if (m) ASSIGN(m, Py_BuildValue("OO", m, name));
if (m) ASSIGN(m, PyString_Format(NoSequenceFormat, m)); if (m) ASSIGN(m, PyString_Format(NoSequenceFormat, m));
if (m) ASSIGN(m, PyObject_CallFunction(LOG, "sOO", if (m) ASSIGN(m, PyObject_CallFunction(warn, "O", m));
"Zope Security Policy", PROBLEM, m));
Py_XDECREF(m); Py_XDECREF(m);
PyErr_Restore(t, v, tb); PyErr_Restore(t, v, tb);
goto err; goto err;
...@@ -2176,7 +2174,7 @@ module_guarded_getattr(PyObject *ignored, PyObject *args) ...@@ -2176,7 +2174,7 @@ module_guarded_getattr(PyObject *ignored, PyObject *args)
static PyObject * static PyObject *
module_aq_validate(PyObject *ignored, PyObject *args) module_aq_validate(PyObject *ignored, PyObject *args)
{ {
PyObject *inst, *obj, *name, *v, *validate; PyObject *inst=NULL, *obj=NULL, *name=NULL, *v=NULL, *validate=NULL;
if (unpacktuple5(args, "validate", 0, if (unpacktuple5(args, "validate", 0,
&inst, &obj, &name, &v, &validate) < 0) return NULL; &inst, &obj, &name, &v, &validate) < 0) return NULL;
...@@ -2331,9 +2329,8 @@ void initcAccessControl(void) { ...@@ -2331,9 +2329,8 @@ void initcAccessControl(void) {
/*| from zLOG import LOG, PROBLEM /*| from zLOG import LOG, PROBLEM
*/ */
IMPORT(module, "zLOG"); IMPORT(module, "logger_wrapper");
GETATTR(module, LOG); GETATTR(module, warn);
GETATTR(module, PROBLEM);
Py_DECREF(module); Py_DECREF(module);
module = NULL; module = NULL;
} }
......
# A wrapper to replace the usage of the zLOG module in cAccessControl without
# having the need to change the C code significantly.
from logging import getLogger
LOG = getLogger('AccessControl')
warn = LOG.warn
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