summaryrefslogtreecommitdiff
path: root/psycopg/psycopgmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'psycopg/psycopgmodule.c')
-rw-r--r--psycopg/psycopgmodule.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/psycopg/psycopgmodule.c b/psycopg/psycopgmodule.c
index 2c4be8c..26cc500 100644
--- a/psycopg/psycopgmodule.c
+++ b/psycopg/psycopgmodule.c
@@ -63,6 +63,10 @@ PyObject *pyPsycopgTzFixedOffsetTimezone = NULL;
PyObject *psycoEncodings = NULL;
+#ifdef PSYCOPG_DEBUG
+int psycopg_debug_enabled = 0;
+#endif
+
/** connect module-level function **/
#define psyco_connect_doc \
"connect(dsn, ...) -- Create a new database connection.\n\n" \
@@ -693,6 +697,11 @@ init_psycopg(void)
PyObject *module, *dict;
PyObject *c_api_object;
+#ifdef PSYCOPG_DEBUG
+ if (getenv("PSYCOPG_DEBUG"))
+ psycopg_debug_enabled = 1;
+#endif
+
Dprintf("initpsycopg: initializing psycopg %s", PSYCOPG_VERSION);
/* initialize all the new types and then the module */