[tracker-miners/wip/carlosg/tap-tests: 1/3] libtracker-miner: Demote g_message() to g_debug()
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/wip/carlosg/tap-tests: 1/3] libtracker-miner: Demote g_message() to g_debug()
- Date: Mon, 22 Mar 2021 11:15:42 +0000 (UTC)
commit c387b1f452b59f26ed00f10414e3d90130d15483
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Mar 22 11:55:04 2021 +0100
libtracker-miner: Demote g_message() to g_debug()
Otherwise these get in TAP output, as g_message() output is not
friendly to the TAP protocol.
src/libtracker-miner/tracker-indexing-tree.c | 2 +-
src/libtracker-miner/tracker-miner-proxy.c | 4 ++--
src/libtracker-miners-common/tracker-language.c | 4 ++--
src/miners/fs/tracker-main.c | 20 ++++++++++----------
src/miners/fs/tracker-miner-files.c | 12 ++++++------
src/tracker-extract/tracker-main.c | 14 +++++++++-----
6 files changed, 30 insertions(+), 26 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-indexing-tree.c b/src/libtracker-miner/tracker-indexing-tree.c
index 58338449f..b72168d02 100644
--- a/src/libtracker-miner/tracker-indexing-tree.c
+++ b/src/libtracker-miner/tracker-indexing-tree.c
@@ -523,7 +523,7 @@ tracker_indexing_tree_add (TrackerIndexingTree *tree,
gchar *uri;
uri = g_file_get_uri (directory);
- g_message ("Overwriting flags for directory '%s'", uri);
+ g_debug ("Overwriting flags for directory '%s'", uri);
g_free (uri);
data->flags = flags;
diff --git a/src/libtracker-miner/tracker-miner-proxy.c b/src/libtracker-miner/tracker-miner-proxy.c
index 556384f06..868b75852 100644
--- a/src/libtracker-miner/tracker-miner-proxy.c
+++ b/src/libtracker-miner/tracker-miner-proxy.c
@@ -364,7 +364,7 @@ pause_process_disappeared_cb (GDBusConnection *connection,
GHashTableIter iter;
gpointer key, value;
- g_message ("Process with name:'%s' has disappeared", name);
+ g_debug ("Process with name:'%s' has disappeared", name);
g_hash_table_iter_init (&iter, priv->pauses);
while (g_hash_table_iter_next (&iter, &key, &value)) {
@@ -409,7 +409,7 @@ pause_miner (TrackerMinerProxy *proxy,
}
if (calling_name) {
- g_message ("Watching process with name:'%s'", calling_name);
+ g_debug ("Watching process with name:'%s'", calling_name);
watch_name_id = g_bus_watch_name (TRACKER_IPC_BUS,
calling_name,
G_BUS_NAME_WATCHER_FLAGS_NONE,
diff --git a/src/libtracker-miners-common/tracker-language.c b/src/libtracker-miners-common/tracker-language.c
index 3e7c26017..80947d19c 100644
--- a/src/libtracker-miners-common/tracker-language.c
+++ b/src/libtracker-miners-common/tracker-language.c
@@ -256,8 +256,8 @@ language_add_stopwords (TrackerLanguage *language,
mapped_file = g_mapped_file_new (filename, FALSE, &error);
if (error) {
- g_message ("Tracker couldn't read stopword file:'%s', %s",
- filename, error->message);
+ g_debug ("Tracker couldn't read stopword file:'%s', %s",
+ filename, error->message);
g_clear_error (&error);
return;
}
diff --git a/src/miners/fs/tracker-main.c b/src/miners/fs/tracker-main.c
index 8ae7e321d..f9ccca3aa 100644
--- a/src/miners/fs/tracker-main.c
+++ b/src/miners/fs/tracker-main.c
@@ -280,9 +280,9 @@ signal_handler (gpointer user_data)
/* Fall through */
default:
if (g_strsignal (signo)) {
- g_message ("Received signal:%d->'%s'",
- signo,
- g_strsignal (signo));
+ g_debug ("Received signal:%d->'%s'",
+ signo,
+ g_strsignal (signo));
}
break;
}
@@ -430,8 +430,8 @@ miner_start (TrackerMiner *miner,
}
slept = FALSE;
- g_message ("Performing initial sleep of %d seconds",
- initial_sleep);
+ g_debug ("Performing initial sleep of %d seconds",
+ initial_sleep);
miners_timeout_id = g_timeout_add_seconds (initial_sleep,
miner_start_idle_cb,
miner);
@@ -1034,13 +1034,13 @@ main (gint argc, gchar *argv[])
main_loop = g_main_loop_new (NULL, FALSE);
if (no_daemon) {
- g_message ("tracker-miner-fs-3 running in --no-daemon mode.");
+ g_debug ("tracker-miner-fs-3 running in --no-daemon mode.");
} else if (domain_ontology_name) {
domain_name = tracker_domain_ontology_get_domain (domain_ontology, NULL);
- g_message ("tracker-miner-fs-3 running in --domain-ontology mode as "
- "%s." DBUS_NAME_SUFFIX ". The service will exit when %s "
- "disappears from the bus.", domain_name, domain_name);
+ g_debug ("tracker-miner-fs-3 running in --domain-ontology mode as "
+ "%s." DBUS_NAME_SUFFIX ". The service will exit when %s "
+ "disappears from the bus.", domain_name, domain_name);
g_bus_watch_name_on_connection (connection, domain_name,
G_BUS_NAME_WATCHER_FLAGS_NONE,
@@ -1048,7 +1048,7 @@ main (gint argc, gchar *argv[])
main_loop, NULL);
g_free (domain_name);
} else {
- g_message ("tracker-miner-fs-3 running as org.freedesktop." DBUS_NAME_SUFFIX);
+ g_debug ("tracker-miner-fs-3 running as org.freedesktop." DBUS_NAME_SUFFIX);
}
if (!dry_run) {
diff --git a/src/miners/fs/tracker-miner-files.c b/src/miners/fs/tracker-miner-files.c
index 323990d56..fc2f4a6e9 100644
--- a/src/miners/fs/tracker-miner-files.c
+++ b/src/miners/fs/tracker-miner-files.c
@@ -1274,7 +1274,7 @@ check_battery_status (TrackerMinerFiles *mf)
on_battery = tracker_power_get_on_battery (mf->private->power);
if (!on_battery) {
- g_message ("Running on AC power");
+ g_debug ("Running on AC power");
should_pause = FALSE;
should_throttle = FALSE;
} else if (on_low_battery) {
@@ -1290,15 +1290,15 @@ check_battery_status (TrackerMinerFiles *mf)
g_message ("Running on battery, but not enabled, pausing");
should_pause = TRUE;
} else if (tracker_miner_files_get_first_index_done (mf)) {
- g_message ("Running on battery and first-time index "
- "already done, pausing");
+ g_debug ("Running on battery and first-time index "
+ "already done, pausing");
should_pause = TRUE;
} else {
- g_message ("Running on battery, but first-time index not "
- "already finished, keeping on");
+ g_debug ("Running on battery, but first-time index not "
+ "already finished, keeping on");
}
} else {
- g_message ("Running on battery");
+ g_debug ("Running on battery");
}
}
diff --git a/src/tracker-extract/tracker-main.c b/src/tracker-extract/tracker-main.c
index 2a646cc6c..c1a09685c 100644
--- a/src/tracker-extract/tracker-main.c
+++ b/src/tracker-extract/tracker-main.c
@@ -150,9 +150,9 @@ signal_handler (gpointer user_data)
/* Fall through */
default:
if (g_strsignal (signo)) {
- g_message ("Received signal:%d->'%s'",
- signo,
- g_strsignal (signo));
+ g_debug ("Received signal:%d->'%s'",
+ signo,
+ g_strsignal (signo));
}
break;
}
@@ -432,8 +432,12 @@ main (int argc, char *argv[])
/* Request DBus name */
dbus_name = tracker_domain_ontology_get_domain (domain_ontology, DBUS_NAME_SUFFIX);
- g_message ("tracker-extract-3 running as %s. The service will exit when %s "
- "disappears from the bus.", dbus_name, miner_dbus_name);
+ if (tracker_term_is_tty ()) {
+ g_debug ("tracker-extract-3 running as %s", dbus_name);
+ } else {
+ g_debug ("tracker-extract-3 running as %s. The service will exit when %s "
+ "disappears from the bus.", dbus_name, miner_dbus_name);
+ }
if (!tracker_dbus_request_name (connection, dbus_name, &error)) {
g_critical ("Could not request DBus name '%s': %s",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]