Commit fe74c941 authored by Martyn Russell's avatar Martyn Russell

all: Depend on GLib 2.40 and use g_info() instead of tracker_info()

This API came in during GLib 2.40.

The tracker_info() is used now for the 'tracker' command's info command and it
make sense to remove the old make-shift tracker_info() API which was for
logging and duplicating g_info() anyway.
parent babe0ff5
......@@ -412,12 +412,12 @@ tracker_dbus_request_info (TrackerDBusRequest *request,
str = g_strdup_vprintf (format, args);
va_end (args);
tracker_info ("---- [%d%s%s|%lu] %s",
request->request_id,
request->cd ? "|" : "",
request->cd ? request->cd->binary : "",
request->cd ? request->cd->pid : 0,
str);
g_info ("---- [%d%s%s|%lu] %s",
request->request_id,
request->cd ? "|" : "",
request->cd ? request->cd->binary : "",
request->cd ? request->cd->pid : 0,
str);
g_free (str);
}
......
......@@ -28,29 +28,6 @@ G_BEGIN_DECLS
#error "only <libtracker-common/tracker-common.h> must be included directly."
#endif
/*
* Add support for G_LOG_LEVEL_INFO through tracker_info().
*/
#ifdef G_HAVE_ISO_VARARGS
#define tracker_info(...) g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_INFO, \
__VA_ARGS__)
#elif defined(G_HAVE_GNUC_VARARGS)
#define tracker_info(format...) g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_INFO, \
format)
#else /* no varargs macros */
static void
tracker_info (const gchar *format,
...)
{
va_list args;
va_start (args, format);
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, format, args);
va_end (args);
}
#endif /* !__GNUC__ */
gboolean tracker_log_init (gint verbosity,
gchar **used_filename);
void tracker_log_shutdown (void);
......
......@@ -629,14 +629,14 @@ finish_current_directory (TrackerFileNotifier *notifier)
priv->current_index_root->files_found,
priv->current_index_root->files_ignored);
tracker_info (" Notified files after %2.2f seconds",
g_timer_elapsed (priv->timer, NULL));
tracker_info (" Found %d directories, ignored %d directories",
priv->current_index_root->directories_found,
priv->current_index_root->directories_ignored);
tracker_info (" Found %d files, ignored %d files",
priv->current_index_root->files_found,
priv->current_index_root->files_ignored);
g_info (" Notified files after %2.2f seconds",
g_timer_elapsed (priv->timer, NULL));
g_info (" Found %d directories, ignored %d directories",
priv->current_index_root->directories_found,
priv->current_index_root->directories_ignored);
g_info (" Found %d files, ignored %d files",
priv->current_index_root->files_found,
priv->current_index_root->files_ignored);
root_data_free (priv->current_index_root);
priv->current_index_root = NULL;
......@@ -826,7 +826,7 @@ crawl_directories_start (TrackerFileNotifier *notifier)
gchar *uri;
uri = g_file_get_uri (directory);
tracker_info ("Processing location: '%s'", uri);
g_info ("Processing location: '%s'", uri);
g_free (uri);
g_timer_reset (priv->timer);
......
......@@ -989,7 +989,7 @@ miner_started (TrackerMiner *miner)
fs->priv->been_started = TRUE;
tracker_info ("Initializing");
g_info ("Initializing");
g_object_set (miner,
"progress", 0.0,
......@@ -1003,7 +1003,7 @@ miner_started (TrackerMiner *miner)
static void
miner_stopped (TrackerMiner *miner)
{
tracker_info ("Idle");
g_info ("Idle");
g_object_set (miner,
"progress", 1.0,
......@@ -1126,22 +1126,22 @@ process_print_stats (TrackerMinerFS *fs)
if (!fs->priv->shown_totals) {
fs->priv->shown_totals = TRUE;
tracker_info ("--------------------------------------------------");
tracker_info ("Total directories : %d (%d ignored)",
fs->priv->total_directories_found,
fs->priv->total_directories_ignored);
tracker_info ("Total files : %d (%d ignored)",
fs->priv->total_files_found,
fs->priv->total_files_ignored);
g_info ("--------------------------------------------------");
g_info ("Total directories : %d (%d ignored)",
fs->priv->total_directories_found,
fs->priv->total_directories_ignored);
g_info ("Total files : %d (%d ignored)",
fs->priv->total_files_found,
fs->priv->total_files_ignored);
#if 0
tracker_info ("Total monitors : %d",
tracker_monitor_get_count (fs->priv->monitor));
g_info ("Total monitors : %d",
tracker_monitor_get_count (fs->priv->monitor));
#endif
tracker_info ("Total processed : %d (%d notified, %d with error)",
fs->priv->total_files_processed,
fs->priv->total_files_notified,
fs->priv->total_files_notified_error);
tracker_info ("--------------------------------------------------\n");
g_info ("Total processed : %d (%d notified, %d with error)",
fs->priv->total_files_processed,
fs->priv->total_files_notified,
fs->priv->total_files_notified_error);
g_info ("--------------------------------------------------\n");
}
}
......@@ -1157,7 +1157,7 @@ process_stop (TrackerMinerFS *fs)
fs->priv->timer_stopped = TRUE;
fs->priv->extraction_timer_stopped = TRUE;
tracker_info ("Idle");
g_info ("Idle");
g_object_set (fs,
"progress", 1.0,
......@@ -2465,7 +2465,7 @@ item_queue_handlers_cb (gpointer user_data)
*/
if (g_strcmp0 (status, "Processing…") != 0) {
/* Don't spam this */
tracker_info ("Processing…");
g_info ("Processing…");
g_object_set (fs,
"status", "Processing…",
"progress", CLAMP (progress_now, 0.02, 1.00),
......@@ -2495,11 +2495,11 @@ item_queue_handlers_cb (gpointer user_data)
items_remaining);
str2 = tracker_seconds_to_string (seconds_elapsed, TRUE);
tracker_info ("Processed %u/%u, estimated %s left, %s elapsed",
items_processed,
items_processed + items_remaining,
str1,
str2);
g_info ("Processed %u/%u, estimated %s left, %s elapsed",
items_processed,
items_processed + items_remaining,
str1,
str2);
g_free (str2);
g_free (str1);
......@@ -2669,7 +2669,7 @@ item_queue_handlers_set_up (TrackerMinerFS *fs)
/* Don't spam this */
if (progress > 0.01 && g_strcmp0 (status, "Processing…") != 0) {
tracker_info ("Processing…");
g_info ("Processing…");
g_object_set (fs, "status", "Processing…", NULL);
}
......@@ -3118,7 +3118,7 @@ file_notifier_finished (TrackerFileNotifier *notifier,
TrackerMinerFS *fs = user_data;
if (!tracker_miner_fs_has_items_to_process (fs)) {
tracker_info ("Finished all tasks");
g_info ("Finished all tasks");
process_stop (fs);
}
}
......
......@@ -157,10 +157,10 @@ miner_finished_cb (TrackerMinerFS *fs,
guint total_files_ignored,
gpointer user_data)
{
tracker_info ("Finished mining in seconds:%f, total directories:%d, total files:%d",
seconds_elapsed,
total_directories_found,
total_files_found);
g_info ("Finished mining in seconds:%f, total directories:%d, total files:%d",
seconds_elapsed,
total_directories_found,
total_files_found);
if (no_daemon && main_loop) {
g_main_loop_quit (main_loop);
......
......@@ -330,10 +330,10 @@ miner_finished_cb (TrackerMinerFS *fs,
guint total_files_ignored,
gpointer user_data)
{
tracker_info ("Finished mining in seconds:%f, total directories:%d, total files:%d",
seconds_elapsed,
total_directories_found,
total_files_found);
g_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)) {
......
......@@ -157,10 +157,10 @@ miner_finished_cb (TrackerMinerFS *fs,
guint total_files_ignored,
gpointer user_data)
{
tracker_info ("Finished mining in seconds:%f, total directories:%d, total files:%d",
seconds_elapsed,
total_directories_found,
total_files_found);
g_info ("Finished mining in seconds:%f, total directories:%d, total files:%d",
seconds_elapsed,
total_directories_found,
total_files_found);
if (no_daemon && main_loop) {
g_main_loop_quit (main_loop);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment