aboutsummaryrefslogtreecommitdiff
path: root/lib/query.cc
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2014-12-26 17:25:35 +0100
committerDavid Bremner <david@tethera.net>2015-03-29 00:34:15 +0100
commit736ac26407914425a9c94e86616225292cf716dd (patch)
tree641ae3fdb6f28233573aa6248796b30421d535f5 /lib/query.cc
parent9b73a8bcc9cb381fc1a15013f4baa3ec9fdb97a7 (diff)
lib: replace almost all fprintfs in library with _n_d_log
This is not supposed to change any functionality from an end user point of view. Note that it will eliminate some output to stderr. The query debugging output is left as is; it doesn't really fit with the current primitive logging model. The remaining "bad" fprintf will need an internal API change.
Diffstat (limited to 'lib/query.cc')
-rw-r--r--lib/query.cc18
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/query.cc b/lib/query.cc
index 57aa6d24..9cedb6a8 100644
--- a/lib/query.cc
+++ b/lib/query.cc
@@ -296,9 +296,12 @@ notmuch_query_search_messages_st (notmuch_query_t *query,
return NOTMUCH_STATUS_SUCCESS;
} catch (const Xapian::Error &error) {
- fprintf (stderr, "A Xapian exception occurred performing query: %s\n",
- error.get_msg().c_str());
- fprintf (stderr, "Query string was: %s\n", query->query_string);
+ _notmuch_database_log (notmuch,
+ "A Xapian exception occurred performing query: %s\n"
+ "Query string was: %s\n",
+ error.get_msg().c_str(),
+ query->query_string);
+
notmuch->exception_reported = TRUE;
talloc_free (messages);
return NOTMUCH_STATUS_XAPIAN_EXCEPTION;
@@ -597,9 +600,12 @@ notmuch_query_count_messages (notmuch_query_t *query)
count = mset.get_matches_estimated();
} catch (const Xapian::Error &error) {
- fprintf (stderr, "A Xapian exception occurred: %s\n",
- error.get_msg().c_str());
- fprintf (stderr, "Query string was: %s\n", query->query_string);
+ _notmuch_database_log (notmuch,
+ "A Xapian exception occurred performing query: %s\n"
+ "Query string was: %s\n",
+ error.get_msg().c_str(),
+ query->query_string);
+
}
return count;