[tracker-miners/sam/debug-more: 2/7] Move various log messages into TRACKER_DEBUG=miner-fs-events



commit a8a0e3a2c6cbef0e090b4f7e9c804e1147cb4d8f
Author: Sam Thursfield <sam afuera me uk>
Date:   Sun Apr 26 00:54:58 2020 +0200

    Move various log messages into TRACKER_DEBUG=miner-fs-events

 src/libtracker-miner/tracker-miner-fs.c      | 37 ++++++++++++++--------------
 src/libtracker-miner/tracker-sparql-buffer.c |  8 +++---
 2 files changed, 24 insertions(+), 21 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 0cd4f3177..bcde7f16a 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -1290,11 +1290,10 @@ on_signal_gtask_complete (GObject      *source,
                if (ctxt->urn) {
                        /* The SPARQL builder will already contain the necessary
                         * DELETE statements for the properties being updated */
-                       g_debug ("Updating item '%s' with urn '%s'",
-                                uri,
-                                ctxt->urn);
+                       TRACKER_NOTE (MINER_FS_EVENTS, g_message ("Updating item '%s' with urn '%s'",
+                                                                 uri, ctxt->urn));
                } else {
-                       g_debug ("Creating new item '%s'", uri);
+                       TRACKER_NOTE (MINER_FS_EVENTS, g_message ("Creating new item '%s'", uri));
                }
 
                sparql_task = tracker_sparql_task_new_take_sparql_str (file, sparql);
@@ -1390,12 +1389,12 @@ item_add_or_update (TrackerMinerFS *fs,
        gtask = g_task_new (fs, ctxt->cancellable, on_signal_gtask_complete, file);
 
        if (!attributes_update) {
-               g_debug ("Processing file '%s'...", uri);
+               TRACKER_NOTE (MINER_FS_EVENTS, g_message ("Processing file '%s'...", uri));
                g_signal_emit (fs, signals[PROCESS_FILE], 0,
                               file, gtask,
                               &processing);
        } else {
-               g_debug ("Processing attributes in file '%s'...", uri);
+               TRACKER_NOTE (MINER_FS_EVENTS, g_message ("Processing attributes in file '%s'...", uri));
                g_signal_emit (fs, signals[PROCESS_FILE_ATTRIBUTES], 0,
                               file, gtask,
                               &processing);
@@ -1430,8 +1429,8 @@ item_remove (TrackerMinerFS *fs,
 
        uri = g_file_get_uri (file);
 
-       g_debug ("Removing item: '%s' (Deleted from filesystem or no longer monitored)",
-                uri);
+       TRACKER_NOTE (MINER_FS_EVENTS,
+                     g_message ("Removing item: '%s' (Deleted from filesystem or no longer monitored)", 
uri));
 
        g_object_set_qdata (G_OBJECT (file),
                            fs->priv->quark_recursive_removal,
@@ -1502,8 +1501,9 @@ item_move (TrackerMinerFS *fs,
                 * files that are immediately renamed to the definitive path).
                 * Deal with those as newly added items.
                 */
-               g_debug ("Source file '%s' not yet in store, indexing '%s' "
-                        "from scratch", source_uri, uri);
+               TRACKER_NOTE (MINER_FS_EVENTS,
+                             g_message ("Source file '%s' not yet in store, indexing '%s' "
+                                        "from scratch", source_uri, uri));
 
                retval = item_add_or_update (fs, dest_file, G_PRIORITY_DEFAULT, FALSE);
 
@@ -1514,9 +1514,9 @@ item_move (TrackerMinerFS *fs,
                return retval;
        }
 
-       g_debug ("Moving item from '%s' to '%s'",
-                source_uri,
-                uri);
+       TRACKER_NOTE (MINER_FS_EVENTS,
+                     g_message ("Moving item from '%s' to '%s'",
+                                source_uri, uri));
 
        tracker_indexing_tree_get_root (fs->priv->indexing_tree, source_file, &source_flags);
        tracker_indexing_tree_get_root (fs->priv->indexing_tree, dest_file, &flags);
@@ -2314,7 +2314,7 @@ indexing_tree_directory_removed (TrackerIndexingTree *indexing_tree,
                                   task_pool_cancel_foreach,
                                   directory);
 
-       g_debug ("  Cancelled processing pool tasks at %f\n", g_timer_elapsed (timer, NULL));
+       TRACKER_NOTE (MINER_FS_EVENTS, g_message ("  Cancelled processing pool tasks at %f\n", 
g_timer_elapsed (timer, NULL)));
 
        /* Remove anything contained in the removed directory
         * from all relevant processing queues.
@@ -2324,7 +2324,7 @@ indexing_tree_directory_removed (TrackerIndexingTree *indexing_tree,
                                               directory,
                                               (GDestroyNotify) queue_event_free);
 
-       g_debug ("  Removed files at %f\n", g_timer_elapsed (timer, NULL));
+       TRACKER_NOTE (MINER_FS_EVENTS, g_message ("  Removed files at %f\n", g_timer_elapsed (timer, NULL)));
        g_timer_destroy (timer);
 }
 
@@ -2405,9 +2405,10 @@ tracker_miner_fs_check_file (TrackerMinerFS *fs,
 
        uri = g_file_get_uri (file);
 
-       g_debug ("%s:'%s' (FILE) (requested by application)",
-                should_process ? "Found " : "Ignored",
-                uri);
+       TRACKER_NOTE (MINER_FS_EVENTS,
+                     g_message ("%s:'%s' (FILE) (requested by application)",
+                                should_process ? "Found " : "Ignored",
+                                uri));
 
        if (should_process) {
                if (check_parents && !check_file_parents (fs, file)) {
diff --git a/src/libtracker-miner/tracker-sparql-buffer.c b/src/libtracker-miner/tracker-sparql-buffer.c
index 086131b73..f88ce7021 100644
--- a/src/libtracker-miner/tracker-sparql-buffer.c
+++ b/src/libtracker-miner/tracker-sparql-buffer.c
@@ -22,6 +22,7 @@
 #include "config-miners.h"
 
 #include <libtracker-sparql/tracker-sparql.h>
+#include "libtracker-miners-common/tracker-debug.h"
 
 #include "tracker-sparql-buffer.h"
 
@@ -229,8 +230,9 @@ tracker_sparql_buffer_update_array_cb (GObject      *object,
        priv = tracker_sparql_buffer_get_instance_private (buffer);
        priv->n_updates--;
 
-       g_debug ("(Sparql buffer) Finished array-update with %u tasks",
-                update_data->tasks->len);
+       TRACKER_NOTE (MINER_FS_EVENTS,
+                     g_message ("(Sparql buffer) Finished array-update with %u tasks",
+                                update_data->tasks->len));
 
        if (!tracker_sparql_connection_update_array_finish (priv->connection,
                                                            result,
@@ -295,7 +297,7 @@ tracker_sparql_buffer_flush (TrackerSparqlBuffer *buffer,
                return FALSE;
        }
 
-       g_debug ("Flushing SPARQL buffer, reason: %s", reason);
+       TRACKER_NOTE (MINER_FS_EVENTS, g_message ("Flushing SPARQL buffer, reason: %s", reason));
 
        if (priv->flush_timeout_id != 0) {
                g_source_remove (priv->flush_timeout_id);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]