[evolution-data-server] sqlitedb: Print errors and debug logs to stderr
- From: Mathias Hasselmann <hasselmm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] sqlitedb: Print errors and debug logs to stderr
- Date: Fri, 1 Feb 2013 12:59:51 +0000 (UTC)
commit af85054dc314e49d5c1881f8fe951f756e2b45a6
Author: Mathias Hasselmann <mathias openismus com>
Date: Thu Jan 31 20:08:56 2013 +0100
sqlitedb: Print errors and debug logs to stderr
That way we can see them in self-contained tests without introducing log files.
https://bugzilla.gnome.org/show_bug.cgi?id=692998
.../libedata-book/e-book-backend-sqlitedb.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/addressbook/libedata-book/e-book-backend-sqlitedb.c b/addressbook/libedata-book/e-book-backend-sqlitedb.c
index a8aaa50..87e5d64 100644
--- a/addressbook/libedata-book/e-book-backend-sqlitedb.c
+++ b/addressbook/libedata-book/e-book-backend-sqlitedb.c
@@ -284,7 +284,7 @@ book_backend_sql_exec_real (sqlite3 *db,
}
if (ret != SQLITE_OK) {
- d (g_print ("Error in SQL EXEC statement: %s [%s].\n", stmt, errmsg));
+ d (g_printerr ("Error in SQL EXEC statement: %s [%s].\n", stmt, errmsg));
g_set_error_literal (
error, E_BOOK_SDB_ERROR,
ret == SQLITE_CONSTRAINT ?
@@ -311,12 +311,12 @@ print_debug_cb (gpointer ref,
{
gint i;
- g_print (" DEBUG BEGIN: %d results\n", col);
+ g_printerr (" DEBUG BEGIN: %d results\n", col);
for (i = 0; i < col; i++)
- g_print (" NAME: '%s' COL: %s\n", name[i], cols[i]);
+ g_printerr (" NAME: '%s' COL: %s\n", name[i], cols[i]);
- g_print (" DEBUG END\n");
+ g_printerr (" DEBUG END\n");
return 0;
}
@@ -332,9 +332,9 @@ book_backend_sql_debug (sqlite3 *db,
GError *local_error = NULL;
debug = g_strconcat ("EXPLAIN QUERY PLAN ", stmt, NULL);
- g_print ("DEBUG STATEMENT: %s\n", stmt);
+ g_printerr ("DEBUG STATEMENT: %s\n", stmt);
book_backend_sql_exec_real (db, debug, print_debug_cb, NULL, &local_error);
- g_print ("DEBUG STATEMENT END: %s%s\n", local_error ? "Error: " : "", local_error ? local_error->message : "Success");
+ g_printerr ("DEBUG STATEMENT END: %s%s\n", local_error ? "Error: " : "", local_error ? local_error->message : "Success");
g_free (debug);
g_clear_error (&local_error);
@@ -960,7 +960,7 @@ book_backend_sqlitedb_load (EBookBackendSqliteDB *ebsdb,
} else {
const gchar *errmsg;
errmsg = sqlite3_errmsg (ebsdb->priv->db);
- d (g_print ("Can't open database %s: %s\n", path, errmsg));
+ d (g_printerr ("Can't open database %s: %s\n", path, errmsg));
g_set_error_literal (
error, E_BOOK_SDB_ERROR, E_BOOK_SDB_ERROR_OTHER, errmsg);
sqlite3_close (ebsdb->priv->db);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]