Commit 240268b9 authored by Sam Thursfield's avatar Sam Thursfield

Enable G_MESSAGES_DEBUG=Tracker rather than G_MESSAGES_DEBUG=all

In order for our g_info()/g_message()/g_debug() log messages to be
handled, we need to have G_MESSAGES_DEBUG=Tracker enabled in the
environment. Previously we would enable G_MESSAGES_DEBUG=all, which
has the effect of also enabling log output from GLib/GIO and other
dependencies.

In the interests of keeping logs clean, we now require the user to
explicitly set G_MESSAGES_DEBUG=all if they want maximum debug output.
parent d5c4f720
......@@ -151,6 +151,18 @@ hide_log_handler (const gchar *domain,
/* do nothing */
}
static void
ensure_g_messages_debug_set ()
{
const gchar *value;
value = g_getenv ("G_MESSAGES_DEBUG");
if (value == NULL) {
g_setenv ("G_MESSAGES_DEBUG", "Tracker", TRUE);
}
}
gboolean
tracker_log_init (gint this_verbosity,
gchar **used_filename)
......@@ -192,8 +204,8 @@ tracker_log_init (gint this_verbosity,
/* If we have debug enabled, we imply G_MESSAGES_DEBUG or we
* see nothing, this came in since GLib 2.32.
*/
if (this_verbosity > 1) {
g_setenv ("G_MESSAGES_DEBUG", "all", TRUE);
if (this_verbosity > 0) {
ensure_g_messages_debug_set ();
}
if (use_log_files) {
......
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