Commit 32f4b45f authored by Martyn Russell's avatar Martyn Russell

all: Improve start/stop logging for all processes

Now we have Starting/Stopping in the log_init/shutdown functions not just the
process and version.

We also only print the log filename if we're writing to a log file at all.

We now don't print to stdout that we're initializing either.

The TrackerConfigFile g_message() line about which file we're "monitoring" is
removed too, this was always the first line and quite redundant anyway now we
use gsettings.
parent 5ed0bbc6
......@@ -306,9 +306,6 @@ config_load (TrackerConfigFile *file)
}
if (!file->monitor) {
g_message ("Setting up monitor for changes to config file:'%s'",
filename);
file->monitor = g_file_monitor_file (file->file,
G_FILE_MONITOR_NONE,
NULL,
......
......@@ -292,7 +292,7 @@ tracker_log_init (gint this_verbosity,
initialized = TRUE;
/* log binary name and version */
g_message ("%s %s", g_get_application_name (), PACKAGE_VERSION);
g_message ("Starting %s %s", g_get_application_name (), PACKAGE_VERSION);
return TRUE;
}
......@@ -304,6 +304,8 @@ tracker_log_shutdown (void)
return;
}
g_message ("Stopping %s %s", g_get_application_name (), PACKAGE_VERSION);
/* Reset default log handler */
g_log_set_default_handler (g_log_default_handler, NULL);
......
......@@ -899,8 +899,6 @@ main (gint argc, gchar *argv[])
return EXIT_SUCCESS;
}
g_print ("Initializing tracker-miner-fs...\n");
initialize_signal_handler ();
/* Initialize logging */
......@@ -916,8 +914,10 @@ main (gint argc, gchar *argv[])
tracker_log_init (tracker_config_get_verbosity (config),
&log_filename);
g_print ("Starting log:\n File:'%s'\n", log_filename);
g_free (log_filename);
if (log_filename) {
g_message ("Using log file:'%s'", log_filename);
g_free (log_filename);
}
sanity_check_option_values (config);
......
......@@ -151,8 +151,10 @@ main (int argc, char **argv)
}
tracker_log_init (verbosity, &log_filename);
g_print ("Starting log:\n File:'%s'\n", log_filename);
g_free (log_filename);
if (log_filename != NULL) {
g_message ("Using log file:'%s'", log_filename);
g_free (log_filename);
}
miner = tracker_miner_rss_new (&error);
if (!miner) {
......
......@@ -370,13 +370,6 @@ main (int argc, char *argv[])
return EXIT_SUCCESS;
}
g_print ("Initializing tracker-extract...\n");
if (!filename) {
g_print (" Shutdown after 30 seconds of inactivity is %s\n",
disable_shutdown ? "disabled" : "enabled");
}
initialize_signal_handler ();
g_type_init ();
......@@ -401,8 +394,13 @@ main (int argc, char *argv[])
}
tracker_log_init (tracker_config_get_verbosity (config), &log_filename);
g_print ("Starting log:\n File:'%s'\n", log_filename);
g_free (log_filename);
if (log_filename != NULL) {
g_message ("Using log file:'%s'", log_filename);
g_free (log_filename);
}
g_message ("Shutdown after 30 seconds of inactivity is %s",
disable_shutdown ? "disabled" : "enabled");
sanity_check_option_values (config);
......
......@@ -183,8 +183,6 @@ License which can be viewed at:
return 0;
}
print ("Initializing tracker-store...\n");
initialize_signal_handler ();
/* This makes sure we don't steal all the system's resources */
......@@ -201,7 +199,9 @@ License which can be viewed at:
/* Initialize other subsystems */
Tracker.Log.init (config.verbosity, out log_filename);
print ("Starting log:\n File:'%s'\n", log_filename);
if (log_filename != null) {
message ("Using log file:'%s'", log_filename);
}
sanity_check_option_values (config);
......
......@@ -117,8 +117,10 @@ main (int argc,
tracker_log_init (tracker_config_get_verbosity (config),
&log_filename);
g_print ("Starting log:\n File:'%s'\n", log_filename);
g_free (log_filename);
if (log_filename != NULL) {
g_message ("Using log file:'%s'", log_filename);
g_free (log_filename);
}
sanity_check_option_values (config);
......
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