[tracker/tracker-0.10] libtracker-miner, buffer: Improve logging of sparql errors
- From: JÃrg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.10] libtracker-miner, buffer: Improve logging of sparql errors
- Date: Thu, 27 Oct 2011 13:22:11 +0000 (UTC)
commit e20fd224ce32bcdfbc0270220fe6f919ab840eb4
Author: Carlos Garnacho <carlos lanedo com>
Date: Fri Oct 21 16:42:07 2011 +0200
libtracker-miner,buffer: Improve logging of sparql errors
On sparql error, both the faulty sparql string and the affected
file(s) are displayed, this is only shown with -v 3.
src/libtracker-miner/tracker-sparql-buffer.c | 47 ++++++++++++++++++++++++++
1 files changed, 47 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-sparql-buffer.c b/src/libtracker-miner/tracker-sparql-buffer.c
index 35f06c2..7cbf387 100644
--- a/src/libtracker-miner/tracker-sparql-buffer.c
+++ b/src/libtracker-miner/tracker-sparql-buffer.c
@@ -304,6 +304,53 @@ tracker_sparql_buffer_update_array_cb (GObject *object,
if (error) {
g_critical (" (Sparql buffer) Error in task %u of the array-update: %s",
i, error->message);
+
+ if (error_pos < update_data->n_bulk_operations) {
+ BulkOperationMerge *bulk;
+ GList *tasks;
+ guint bulk_pos;
+
+ bulk_pos = ABS (error_pos - update_data->n_bulk_operations + 1);
+ bulk = g_ptr_array_index (update_data->bulk_ops, bulk_pos);
+ tasks = bulk->tasks;
+
+ g_debug (" Affected files:");
+
+ while (tasks) {
+ TrackerTask *task = tasks->data;
+ gchar *uri;
+
+ uri = g_file_get_uri (tracker_task_get_file (task));
+ g_debug (" - %s", uri);
+ g_free (uri);
+
+ tasks = tasks->next;
+ }
+
+ g_debug (" Sparql: %s", bulk->sparql);
+ } else {
+ const gchar *sparql;
+ gchar *uri;
+
+ uri = g_file_get_uri (tracker_task_get_file (task));
+ g_debug (" Affected file: %s", uri);
+ g_free (uri);
+
+ switch (task_data->type) {
+ case TASK_TYPE_SPARQL_STR:
+ sparql = task_data->data.str;
+ break;
+ case TASK_TYPE_SPARQL:
+ sparql = tracker_sparql_builder_get_result (task_data->data.builder);
+ break;
+ default:
+ break;
+ }
+
+ if (sparql) {
+ g_debug (" Sparql: %s", sparql);
+ }
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]