* mu-util-xapian: do extra logging, small updates

This commit is contained in:
Dirk-Jan C. Binnema 2010-01-24 00:50:23 +02:00
parent 9967751b1d
commit 74b2cc5e69
2 changed files with 7 additions and 3 deletions

View File

@ -42,6 +42,10 @@ mu_util_xapian_db_version (const gchar *xpath)
Xapian::Database db (xpath);
const std::string version
(db.get_metadata (MU_XAPIAN_VERSION_KEY));
MU_WRITE_LOG ("database version: '%s', expected '%s'",
version.empty() ? "<none>" : version.c_str(),
MU_XAPIAN_DB_VERSION);
return version.empty() ? NULL : g_strdup (version.c_str());
@ -80,6 +84,8 @@ mu_util_xapian_clear_database (const gchar *xpath)
(xpath, Xapian::DB_CREATE_OR_OVERWRITE);
db.flush ();
MU_WRITE_LOG ("emptied database %s", xpath);
return TRUE;
} MU_XAPIAN_CATCH_BLOCK;

View File

@ -35,7 +35,7 @@ G_BEGIN_DECLS
* @return the version of the database as a newly allocated string
* (free with g_free); if there is no version yet, it will return NULL
*/
char* mu_util_xapian_db_version (const gchar *xpath);
gchar* mu_util_xapian_db_version (const gchar *xpath) G_GNUC_WARN_UNUSED_RESULT;
/**
@ -47,8 +47,6 @@ char* mu_util_xapian_db_version (const gchar *xpath);
*/
gboolean mu_util_xapian_db_version_up_to_date (const gchar *xpath);
/**
* clear the database, ie., remove all of the contents. This is a
* destructive operation, but the database can be restored be doing a