[tracker/wip/carlosg/libtracker-miner-cleanups: 13/36] libtracker*: Lower g_message()s to g_debug()



commit b9426b5a188669a0aedcd564bf7e7f9ef701d0ef
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Oct 16 11:49:37 2017 +0200

    libtracker*: Lower g_message()s to g_debug()
    
    This is library code, so let's use g_debug() which obeys G_MESSAGES_DEBUG,
    instead of g_message() which shall be printed unless there is an special
    log handler that filters those out.
    This code may run on 3rd party code, where we can't trust we'll have
    a log handler that catches those from going to stdout.

 src/libtracker-common/tracker-file-utils.c |    8 ++++----
 src/libtracker-miner/tracker-miner-fs.c    |    2 --
 src/libtracker-miner/tracker-monitor.c     |   12 ++++++------
 3 files changed, 10 insertions(+), 12 deletions(-)
---
diff --git a/src/libtracker-common/tracker-file-utils.c b/src/libtracker-common/tracker-file-utils.c
index 94b1113..ce9b7e9 100644
--- a/src/libtracker-common/tracker-file-utils.c
+++ b/src/libtracker-common/tracker-file-utils.c
@@ -345,10 +345,10 @@ tracker_file_system_has_enough_space (const gchar *path,
                                    str2,
                                    str1);
                } else {
-                       g_message ("Checking for adequate disk space to create databases, "
-                                  "%s remaining, %s required as a minimum",
-                                  str2,
-                                  str1);
+                       g_debug ("Checking for adequate disk space to create databases, "
+                                "%s remaining, %s required as a minimum",
+                                str2,
+                                str1);
                }
 
                g_free (str2);
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 3ace431..0b65cc8 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -2395,8 +2395,6 @@ indexing_tree_directory_removed (TrackerIndexingTree *indexing_tree,
                                               (GDestroyNotify) queue_event_free);
 
        g_debug ("  Removed files at %f\n", g_timer_elapsed (timer, NULL));
-
-       g_message ("Finished remove directory operation in %f\n", g_timer_elapsed (timer, NULL));
        g_timer_destroy (timer);
 }
 
diff --git a/src/libtracker-miner/tracker-monitor.c b/src/libtracker-miner/tracker-monitor.c
index 0b426cb..29f6984 100644
--- a/src/libtracker-miner/tracker-monitor.c
+++ b/src/libtracker-miner/tracker-monitor.c
@@ -284,7 +284,7 @@ tracker_monitor_init (TrackerMonitor *object)
                if (strcmp (name, "GInotifyDirectoryMonitor") == 0 ||
                    strcmp (name, "GInotifyFileMonitor") == 0) {
                        /* Using inotify */
-                       g_message ("Monitor backend is Inotify");
+                       g_debug ("Monitor backend is Inotify");
 
                        /* Setting limit based on kernel
                         * settings in /proc...
@@ -307,13 +307,13 @@ tracker_monitor_init (TrackerMonitor *object)
                else if (strcmp (name, "GKqueueDirectoryMonitor") == 0 ||
                         strcmp (name, "GKqueueFileMonitor") == 0) {
                        /* Using kqueue(2) */
-                       g_message ("Monitor backend is kqueue");
+                       g_debug ("Monitor backend is kqueue");
 
                        priv->monitor_limit = get_kqueue_limit ();
                }
                else if (strcmp (name, "GFamDirectoryMonitor") == 0) {
                        /* Using Fam */
-                       g_message ("Monitor backend is Fam");
+                       g_debug ("Monitor backend is Fam");
 
                        /* Setting limit to an arbitary limit
                         * based on testing
@@ -323,14 +323,14 @@ tracker_monitor_init (TrackerMonitor *object)
                }
                else if (strcmp (name, "GFenDirectoryMonitor") == 0) {
                        /* Using Fen, what is this? */
-                       g_message ("Monitor backend is Fen");
+                       g_debug ("Monitor backend is Fen");
 
                        /* Guessing limit... */
                        priv->monitor_limit = 8192;
                }
                else if (strcmp (name, "GWin32DirectoryMonitor") == 0) {
                        /* Using Windows */
-                       g_message ("Monitor backend is Windows");
+                       g_debug ("Monitor backend is Windows");
 
                        /* Guessing limit... */
                        priv->monitor_limit = 8192;
@@ -350,7 +350,7 @@ tracker_monitor_init (TrackerMonitor *object)
        }
 
        g_object_unref (file);
-       g_message ("Monitor limit is %d", priv->monitor_limit);
+       g_debug ("Monitor limit is %d", priv->monitor_limit);
 }
 
 static void


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