[tracker-miners/sam/log-on-startup] Log a g_message() on startup




commit 30fa0b21fec716daf22bd2a54d8fbcbcf43437ee
Author: Sam Thursfield <sam afuera me uk>
Date:   Mon Aug 24 18:23:50 2020 +0200

    Log a g_message() on startup
    
    The Tracker daemons used to be very verbose. We cleaned a lot of this up
    behind TRACKER_DEBUG= but we went too far. I now find myself wondering
    if logging to the journal is working. This commit guarantees that we
    output at least one log message on startup to confirm that logging is
    working.

 src/miners/fs/tracker-main.c       | 21 ++++++++++-----------
 src/tracker-extract/tracker-main.c |  3 +++
 2 files changed, 13 insertions(+), 11 deletions(-)
---
diff --git a/src/miners/fs/tracker-main.c b/src/miners/fs/tracker-main.c
index 1de6bcf6c..220916dc3 100644
--- a/src/miners/fs/tracker-main.c
+++ b/src/miners/fs/tracker-main.c
@@ -974,25 +974,24 @@ main (gint argc, gchar *argv[])
 
        main_loop = g_main_loop_new (NULL, FALSE);
 
-       if (domain_ontology && domain_ontology_name) {
-               /* If we are running for a specific domain, we tie the lifetime of this
-                * process to the domain. For example, if the domain name is
-                * org.example.MyApp then this tracker-miner-fs process will exit as
-                * soon as org.example.MyApp exits.
-                */
+       if (no_daemon) {
+               g_message ("tracker-miner-fs-3 running in --no-daemon mode.");
+       } else if (domain_ontology && 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_bus_watch_name_on_connection (connection, domain_name,
                                                G_BUS_NAME_WATCHER_FLAGS_NONE,
                                                NULL, on_domain_vanished,
                                                main_loop, NULL);
                g_free (domain_name);
+       } else {
+               g_message ("tracker-miner-fs-3 running as org.freedesktop." DBUS_NAME_SUFFIX);
        }
 
-       TRACKER_NOTE (CONFIG, g_message ("Checking if we're running as a daemon:"));
-       TRACKER_NOTE (CONFIG, g_message ("  %s %s",
-                             no_daemon ? "No" : "Yes",
-                             no_daemon ? "(forced by command line)" : ""));
-
        if (!dry_run) {
                GFile *store = get_cache_dir (domain_ontology);
                tracker_error_report_init (store);
diff --git a/src/tracker-extract/tracker-main.c b/src/tracker-extract/tracker-main.c
index 1702cfd15..2a646cc6c 100644
--- a/src/tracker-extract/tracker-main.c
+++ b/src/tracker-extract/tracker-main.c
@@ -432,6 +432,9 @@ 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_dbus_request_name (connection, dbus_name, &error)) {
                g_critical ("Could not request DBus name '%s': %s",
                            dbus_name, error->message);


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