]> code.citadel.org Git - citadel.git/commitdiff
* Only call set_msgcall() if Berkeley DB is v4.3 or newer
authorArt Cancro <ajc@citadel.org>
Fri, 26 Jan 2007 21:29:17 +0000 (21:29 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 26 Jan 2007 21:29:17 +0000 (21:29 +0000)
* Also call set_errcall() for more verbose logging of errors

citadel/database_sleepycat.c

index e29ce5b0883b22f235908bbdbe2f9245082b0ad6..cfa60460a54cca3b3bbf43ca2d5dfa0c0c5e1878 100644 (file)
@@ -77,6 +77,13 @@ void cdb_verbose_log(const DB_ENV *dbenv, const char *msg)
 }
 
 
+/* Verbose logging callback */
+void cdb_verbose_err(const DB_ENV *dbenv, const char *errpfx, const char *msg)
+{
+       lprintf(CTDL_ALERT, "BDB: %s\n", msg);
+}
+
+
 /* just a little helper function */
 static void txabort(DB_TXN * tid)
 {
@@ -366,7 +373,11 @@ void open_databases(void)
        }
        dbenv->set_errpfx(dbenv, "citserver");
        dbenv->set_paniccall(dbenv, dbpanic);
+       dbenv->set_errcall(dbenv, cdb_verbose_err);
+       dbenv->set_errpfx(dbenv, "ctdl");
+#if (DB_VERSION_MAJOR == 4) && (DB_VERSION_MINOR >= 3)
        dbenv->set_msgcall(dbenv, cdb_verbose_log);
+#endif
        dbenv->set_verbose(dbenv, DB_VERB_DEADLOCK, 1);
        dbenv->set_verbose(dbenv, DB_VERB_RECOVERY, 1);