Dropped debug info for microprotocols/adapters initialization

Not useful anymore (guess they were when those layers were created).
Much shorter stream of messages on module init now.
This commit is contained in:
Daniele Varrazzo 2019-03-07 21:33:18 +00:00
parent d61c902230
commit 0935c9d8ca
9 changed files with 2 additions and 33 deletions

View File

@ -38,8 +38,6 @@
RAISES_NEG int RAISES_NEG int
psyco_adapter_datetime_init(void) psyco_adapter_datetime_init(void)
{ {
Dprintf("psyco_adapter_datetime_init: datetime init");
PyDateTime_IMPORT; PyDateTime_IMPORT;
if (!PyDateTimeAPI) { if (!PyDateTimeAPI) {

View File

@ -38,8 +38,6 @@
int int
psyco_adapter_mxdatetime_init(void) psyco_adapter_mxdatetime_init(void)
{ {
Dprintf("psyco_adapter_mxdatetime_init: mx.DateTime init");
if (mxDateTime_ImportModuleAndAPI()) { if (mxDateTime_ImportModuleAndAPI()) {
Dprintf("psyco_adapter_mxdatetime_init: mx.DateTime initialization failed"); Dprintf("psyco_adapter_mxdatetime_init: mx.DateTime initialization failed");
PyErr_Clear(); PyErr_Clear();

View File

@ -68,8 +68,6 @@ microprotocols_add(PyTypeObject *type, PyObject *proto, PyObject *cast)
if (proto == NULL) proto = (PyObject*)&isqlquoteType; if (proto == NULL) proto = (PyObject*)&isqlquoteType;
Dprintf("microprotocols_add: cast %p for (%s, ?)", cast, type->tp_name);
if (!(key = PyTuple_Pack(2, (PyObject*)type, proto))) { goto exit; } if (!(key = PyTuple_Pack(2, (PyObject*)type, proto))) { goto exit; }
if (0 != PyDict_SetItem(psyco_adapters, key, cast)) { goto exit; } if (0 != PyDict_SetItem(psyco_adapters, key, cast)) { goto exit; }

View File

@ -303,7 +303,7 @@ adapters_init(PyObject *module)
if (0 > microprotocols_init(module)) { goto exit; } if (0 > microprotocols_init(module)) { goto exit; }
Dprintf("psycopgmodule: configuring adapters"); Dprintf("psycopgmodule: initializing adapters");
if (0 > microprotocols_add(&PyFloat_Type, NULL, (PyObject*)&pfloatType)) { if (0 > microprotocols_add(&PyFloat_Type, NULL, (PyObject*)&pfloatType)) {
goto exit; goto exit;
@ -935,7 +935,7 @@ datetime_init(void)
{ {
PyObject *dt = NULL; PyObject *dt = NULL;
Dprintf("psycopgmodule: datetime module"); Dprintf("psycopgmodule: initializing datetime module");
/* import python builtin datetime module, if available */ /* import python builtin datetime module, if available */
if (!(dt = PyImport_ImportModule("datetime"))) { if (!(dt = PyImport_ImportModule("datetime"))) {

View File

@ -198,8 +198,6 @@ psyco_repl_curs_send_feedback(replicationCursorObject *self,
RAISES_NEG int RAISES_NEG int
psyco_repl_curs_datetime_init(void) psyco_repl_curs_datetime_init(void)
{ {
Dprintf("psyco_repl_curs_datetime_init: datetime init");
PyDateTime_IMPORT; PyDateTime_IMPORT;
if (!PyDateTimeAPI) { if (!PyDateTimeAPI) {

View File

@ -33,8 +33,6 @@
RAISES_NEG int RAISES_NEG int
psyco_replmsg_datetime_init(void) psyco_replmsg_datetime_init(void)
{ {
Dprintf("psyco_replmsg_datetime_init: datetime init");
PyDateTime_IMPORT; PyDateTime_IMPORT;
if (!PyDateTimeAPI) { if (!PyDateTimeAPI) {

View File

@ -271,8 +271,6 @@ typecast_init(PyObject *module)
/* insert the cast types into the 'types' dictionary and register them in /* insert the cast types into the 'types' dictionary and register them in
the module dictionary */ the module dictionary */
for (i = 0; typecast_builtins[i].name != NULL; i++) { for (i = 0; typecast_builtins[i].name != NULL; i++) {
Dprintf("typecast_init: initializing %s", typecast_builtins[i].name);
t = (typecastObject *)typecast_from_c(&(typecast_builtins[i]), dict); t = (typecastObject *)typecast_from_c(&(typecast_builtins[i]), dict);
if (t == NULL) { goto exit; } if (t == NULL) { goto exit; }
if (typecast_add((PyObject *)t, NULL, 0) < 0) { goto exit; } if (typecast_add((PyObject *)t, NULL, 0) < 0) { goto exit; }
@ -295,7 +293,6 @@ typecast_init(PyObject *module)
#ifdef HAVE_MXDATETIME #ifdef HAVE_MXDATETIME
if (0 == psyco_typecast_mxdatetime_init()) { if (0 == psyco_typecast_mxdatetime_init()) {
for (i = 0; typecast_mxdatetime[i].name != NULL; i++) { for (i = 0; typecast_mxdatetime[i].name != NULL; i++) {
Dprintf("typecast_init: initializing %s", typecast_mxdatetime[i].name);
t = (typecastObject *)typecast_from_c(&(typecast_mxdatetime[i]), dict); t = (typecastObject *)typecast_from_c(&(typecast_mxdatetime[i]), dict);
if (t == NULL) { goto exit; } if (t == NULL) { goto exit; }
PyDict_SetItem(dict, t->name, (PyObject *)t); PyDict_SetItem(dict, t->name, (PyObject *)t);
@ -307,7 +304,6 @@ typecast_init(PyObject *module)
if (0 > psyco_typecast_datetime_init()) { goto exit; } if (0 > psyco_typecast_datetime_init()) { goto exit; }
for (i = 0; typecast_pydatetime[i].name != NULL; i++) { for (i = 0; typecast_pydatetime[i].name != NULL; i++) {
Dprintf("typecast_init: initializing %s", typecast_pydatetime[i].name);
t = (typecastObject *)typecast_from_c(&(typecast_pydatetime[i]), dict); t = (typecastObject *)typecast_from_c(&(typecast_pydatetime[i]), dict);
if (t == NULL) { goto exit; } if (t == NULL) { goto exit; }
PyDict_SetItem(dict, t->name, (PyObject *)t); PyDict_SetItem(dict, t->name, (PyObject *)t);
@ -331,23 +327,15 @@ typecast_add(PyObject *obj, PyObject *dict, int binary)
typecastObject *type = (typecastObject *)obj; typecastObject *type = (typecastObject *)obj;
Dprintf("typecast_add: object at %p, values refcnt = "
FORMAT_CODE_PY_SSIZE_T,
obj, Py_REFCNT(type->values)
);
if (dict == NULL) if (dict == NULL)
dict = (binary ? psyco_binary_types : psyco_types); dict = (binary ? psyco_binary_types : psyco_types);
len = PyTuple_Size(type->values); len = PyTuple_Size(type->values);
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
val = PyTuple_GetItem(type->values, i); val = PyTuple_GetItem(type->values, i);
Dprintf("typecast_add: adding val: %ld", PyInt_AsLong(val));
PyDict_SetItem(dict, val, obj); PyDict_SetItem(dict, val, obj);
} }
Dprintf("typecast_add: base caster: %p", type->bcast);
return 0; return 0;
} }
@ -531,9 +519,6 @@ typecast_new(PyObject *name, PyObject *values, PyObject *cast, PyObject *base)
obj = PyObject_GC_New(typecastObject, &typecastType); obj = PyObject_GC_New(typecastObject, &typecastType);
if (obj == NULL) return NULL; if (obj == NULL) return NULL;
Dprintf("typecast_new: new type at = %p, refcnt = " FORMAT_CODE_PY_SSIZE_T,
obj, Py_REFCNT(obj));
Py_INCREF(values); Py_INCREF(values);
obj->values = values; obj->values = values;
@ -560,8 +545,6 @@ typecast_new(PyObject *name, PyObject *values, PyObject *cast, PyObject *base)
PyObject_GC_Track(obj); PyObject_GC_Track(obj);
Dprintf("typecast_new: typecast object created at %p", obj);
return (PyObject *)obj; return (PyObject *)obj;
} }

View File

@ -29,8 +29,6 @@
RAISES_NEG static int RAISES_NEG static int
psyco_typecast_datetime_init(void) psyco_typecast_datetime_init(void)
{ {
Dprintf("psyco_typecast_datetime_init: datetime init");
PyDateTime_IMPORT; PyDateTime_IMPORT;
if (!PyDateTimeAPI) { if (!PyDateTimeAPI) {

View File

@ -31,8 +31,6 @@
static int static int
psyco_typecast_mxdatetime_init(void) psyco_typecast_mxdatetime_init(void)
{ {
Dprintf("psyco_typecast_mxdatetime_init: mx.DateTime init");
if (mxDateTime_ImportModuleAndAPI()) { if (mxDateTime_ImportModuleAndAPI()) {
Dprintf("psyco_typecast_mxdatetime_init: mx.DateTime initialization failed"); Dprintf("psyco_typecast_mxdatetime_init: mx.DateTime initialization failed");
PyErr_Clear(); PyErr_Clear();