aboutsummaryrefslogtreecommitdiff
path: root/lib/message.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/message.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/message.cc')
-rw-r--r--lib/message.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/message.cc b/lib/message.cc
index b84e5e1c..a8ca9884 100644
--- a/lib/message.cc
+++ b/lib/message.cc
@@ -252,7 +252,7 @@ _notmuch_message_create_for_message_id (notmuch_database_t *notmuch,
doc_id = _notmuch_database_generate_doc_id (notmuch);
} catch (const Xapian::Error &error) {
- fprintf (stderr, "A Xapian exception occurred creating message: %s\n",
+ _notmuch_database_log(_notmuch_message_database (message), "A Xapian exception occurred creating message: %s\n",
error.get_msg().c_str());
notmuch->exception_reported = TRUE;
*status_ret = NOTMUCH_PRIVATE_STATUS_XAPIAN_EXCEPTION;
@@ -467,7 +467,7 @@ notmuch_message_get_header (notmuch_message_t *message, const char *header)
return talloc_strdup (message, value.c_str ());
} catch (Xapian::Error &error) {
- fprintf (stderr, "A Xapian exception occurred when reading header: %s\n",
+ _notmuch_database_log(_notmuch_message_database (message), "A Xapian exception occurred when reading header: %s\n",
error.get_msg().c_str());
message->notmuch->exception_reported = TRUE;
return NULL;
@@ -921,7 +921,7 @@ notmuch_message_get_date (notmuch_message_t *message)
try {
value = message->doc.get_value (NOTMUCH_VALUE_TIMESTAMP);
} catch (Xapian::Error &error) {
- fprintf (stderr, "A Xapian exception occurred when reading date: %s\n",
+ _notmuch_database_log(_notmuch_message_database (message), "A Xapian exception occurred when reading date: %s\n",
error.get_msg().c_str());
message->notmuch->exception_reported = TRUE;
return 0;