[tracker] libtracker-miner: Use G_LOG_LEVEL_INFO for status and stats



commit 552f870cf314101705f2e5e5fdfab5453b040683
Author: Martyn Russell <martyn lanedo com>
Date:   Fri Jan 7 10:46:12 2011 +0000

    libtracker-miner: Use G_LOG_LEVEL_INFO for status and stats

 src/libtracker-miner/tracker-miner-fs.c |   46 +++++++++++++++++--------------
 src/miners/fs/tracker-main.c            |    8 +++---
 2 files changed, 29 insertions(+), 25 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index f7da06b..c15599f 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -881,6 +881,8 @@ miner_started (TrackerMiner *miner)
 
 	fs->private->been_started = TRUE;
 
+	tracker_info ("Initializing");
+
 	g_object_set (miner,
 	              "progress", 0.0,
 	              "status", "Initializing",
@@ -892,6 +894,8 @@ miner_started (TrackerMiner *miner)
 static void
 miner_stopped (TrackerMiner *miner)
 {
+	tracker_info ("Idle");
+
 	g_object_set (miner,
 	              "progress", 1.0,
 	              "status", "Idle",
@@ -1003,20 +1007,20 @@ process_print_stats (TrackerMinerFS *fs)
 	if (!fs->private->shown_totals) {
 		fs->private->shown_totals = TRUE;
 
-		g_message ("--------------------------------------------------");
-		g_message ("Total directories : %d (%d ignored)",
-		           fs->private->total_directories_found,
-		           fs->private->total_directories_ignored);
-		g_message ("Total files       : %d (%d ignored)",
-		           fs->private->total_files_found,
-		           fs->private->total_files_ignored);
-		g_message ("Total monitors    : %d",
-		           tracker_monitor_get_count (fs->private->monitor));
-		g_message ("Total processed   : %d (%d notified, %d with error)",
-		           fs->private->total_files_processed,
-		           fs->private->total_files_notified,
-		           fs->private->total_files_notified_error);
-		g_message ("--------------------------------------------------\n");
+		tracker_info ("--------------------------------------------------");
+		tracker_info ("Total directories : %d (%d ignored)",
+		              fs->private->total_directories_found,
+		              fs->private->total_directories_ignored);
+		tracker_info ("Total files       : %d (%d ignored)",
+		              fs->private->total_files_found,
+		              fs->private->total_files_ignored);
+		tracker_info ("Total monitors    : %d",
+		              tracker_monitor_get_count (fs->private->monitor));
+		tracker_info ("Total processed   : %d (%d notified, %d with error)",
+		              fs->private->total_files_processed,
+		              fs->private->total_files_notified,
+		              fs->private->total_files_notified_error);
+		tracker_info ("--------------------------------------------------\n");
 	}
 }
 
@@ -1026,7 +1030,7 @@ process_stop (TrackerMinerFS *fs)
 	/* Now we have finished crawling, print stats and enable monitor events */
 	process_print_stats (fs);
 
-	g_message ("Idle");
+	tracker_info ("Idle");
 
 	g_object_set (fs,
 	              "progress", 1.0,
@@ -2676,7 +2680,7 @@ item_queue_handlers_cb (gpointer user_data)
 
 			if (g_strcmp0 (status, "Processingâ?¦") != 0) {
 				/* Don't spam this */
-				g_message ("Processingâ?¦");
+				tracker_info ("Processingâ?¦");
 				g_object_set (fs,
 				              "status", "Processingâ?¦",
 				              "progress", progress_now,
@@ -2824,7 +2828,7 @@ item_queue_handlers_set_up (TrackerMinerFS *fs)
 
 		if (g_strcmp0 (status, "Processingâ?¦") != 0) {
 			/* Don't spam this */
-			g_message ("Processingâ?¦");
+			tracker_info ("Processingâ?¦");
 			g_object_set (fs, "status", "Processingâ?¦", NULL);
 		}
 
@@ -3677,9 +3681,9 @@ crawler_finished_cb (TrackerCrawler *crawler,
 
 	fs->private->is_crawling = FALSE;
 
-	g_message ("%s crawling files after %2.2f seconds",
-	           was_interrupted ? "Stopped" : "Finished",
-	           g_timer_elapsed (fs->private->timer, NULL));
+	tracker_info ("%s crawling files after %2.2f seconds",
+	              was_interrupted ? "Stopped" : "Finished",
+	              g_timer_elapsed (fs->private->timer, NULL));
 
 	directory_data_unref (fs->private->current_directory);
 	fs->private->current_directory = NULL;
@@ -3744,7 +3748,7 @@ crawl_directories_cb (gpointer user_data)
 	}
 	g_free (path_utf8);
 
-	g_message ("%s", str);
+	tracker_info ("%s", str);
 
 	/* Always set the progress here to at least 1% */
 	g_object_set (fs,
diff --git a/src/miners/fs/tracker-main.c b/src/miners/fs/tracker-main.c
index 5186369..38cc3b8 100644
--- a/src/miners/fs/tracker-main.c
+++ b/src/miners/fs/tracker-main.c
@@ -261,10 +261,10 @@ miner_finished_cb (TrackerMinerFS *fs,
                    guint           total_files_ignored,
                    gpointer        user_data)
 {
-	g_message ("Finished mining in seconds:%f, total directories:%d, total files:%d",
-	           seconds_elapsed,
-	           total_directories_found,
-	           total_files_found);
+	tracker_info ("Finished mining in seconds:%f, total directories:%d, total files:%d",
+	              seconds_elapsed,
+	              total_directories_found,
+	              total_files_found);
 
 	if (TRACKER_IS_MINER_FILES (fs) &&
 	    tracker_miner_fs_get_initial_crawling (fs)) {



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