[Zodb-checkins] CVS: ZODB3/Persistence - cPersistence.c:1.72.8.3

Jeremy Hylton jeremy at zope.com
Tue Jul 1 16:46:29 EDT 2003


Update of /cvs-repository/ZODB3/Persistence
In directory cvs.zope.org:/tmp/cvs-serv31235

Modified Files:
      Tag: zodb33-devel-branch
	cPersistence.c 
Log Message:
Remove DEBUG_LOG define.


=== ZODB3/Persistence/cPersistence.c 1.72.8.2 => 1.72.8.3 ===
--- ZODB3/Persistence/cPersistence.c:1.72.8.2	Tue Jul  1 15:44:05 2003
+++ ZODB3/Persistence/cPersistence.c	Tue Jul  1 15:46:28 2003
@@ -32,25 +32,6 @@
 
 static PyObject *TimeStamp;
 
-#ifdef DEBUG_LOG
-static PyObject *debug_log=0;
-static int idebug_log=0;
-
-static void *
-call_debug(char *event, cPersistentObject *self)
-{
-  PyObject *r;
-
-  /*
-  printf("%s %p\n",event,self->ob_type->tp_name);
-  */
-  r=PyObject_CallFunction(debug_log,"s(sOi)",event,
-			  self->ob_type->tp_name, self->oid,
-			  self->state);
-  Py_XDECREF(r);
-}
-#endif
-
 static int
 init_strings(void)
 {
@@ -278,10 +259,6 @@
 {
   PyObject *dict, *dict2=NULL;
 
-#ifdef DEBUG_LOG
-  if (idebug_log < 0) call_debug("reinit",self);
-#endif
-
   if (args && !checknoargs(args))
     return NULL;
 
@@ -328,11 +305,6 @@
     if (!checknoargs(args))
         return NULL;
 
-#ifdef DEBUG_LOG
-    if (idebug_log < 0)
-        call_debug("get",self);
-#endif
-
     if (!unghostify(self))
         return NULL;
 
@@ -380,9 +352,6 @@
 
   if (_PyObject_GetDictPtr((PyObject *)self)) {
        UNLESS(PyArg_ParseTuple(args, "O", &v)) return NULL;
-#ifdef DEBUG_LOG
-       if (idebug_log < 0) call_debug("set",self);
-#endif
        if (v!=Py_None)
 	 {
 	     PyObject **dictptr = _PyObject_GetDictPtr((PyObject *)self);
@@ -441,9 +410,6 @@
 static void
 Per_dealloc(cPersistentObject *self)
 {
-#ifdef DEBUG_LOG
-  if (idebug_log < 0) call_debug("del",self);
-#endif
   deallocated(self);
   Py_DECREF(self->ob_type);
   self->ob_type->tp_free(self);
@@ -802,35 +768,6 @@
 /* End of code for Persistent objects */
 /* -------------------------------------------------------- */
 
-/* List of methods defined in the module */
-
-#ifdef DEBUG_LOG
-static PyObject *
-set_debug_log(PyObject *ignored, PyObject *args)
-{
-  Py_INCREF(args);
-  ASSIGN(debug_log, args);
-  if (debug_log) idebug_log=-1;
-  else idebug_log=0;
-  Py_INCREF(Py_None);
-  return Py_None;
-}
-#endif
-
-static struct PyMethodDef cP_methods[] = {
-#ifdef DEBUG_LOG
-  {"set_debug_log", (PyCFunction)set_debug_log, METH_VARARGS,
-   "set_debug_log(callable) -- Provide a function to log events\n"
-   "\n"
-   "The function will be called with an event name and a persistent object.\n"
-  },
-#endif
-  {NULL,		NULL}		/* sentinel */
-};
-
-
-/* Initialization function for the module (*must* be called initcPersistence) */
-
 typedef int (*intfunctionwithpythonarg)(PyObject*);
 
 static cPersistenceCAPIstruct
@@ -858,7 +795,7 @@
     if (init_strings() < 0) 
       return;
     
-    m = Py_InitModule4("cPersistence", cP_methods, cPersistence_doc_string,
+    m = Py_InitModule4("cPersistence", NULL, cPersistence_doc_string,
 		     (PyObject*)NULL, PYTHON_API_VERSION);
     
 




More information about the Zodb-checkins mailing list