core: Set G_MESSAGES_DEBUG when parsing debug domains
authorPhilip Withnall <philip@tecnocode.co.uk>
Mon, 9 Jan 2012 10:55:02 +0000 (10:55 +0000)
committerPhilip Withnall <philip@tecnocode.co.uk>
Mon, 9 Jan 2012 10:55:02 +0000 (10:55 +0000)
This stops GLib from dropping all our debug output (unless the user has
remembered to set G_MESSAGES_DEBUG manually in addition to FOLKS_DEBUG).

folks/debug.vala

index 233af2f..1cdfcc6 100644 (file)
@@ -255,6 +255,11 @@ public class Folks.Debug : Object
 
       retval.colour_enabled = colour_enabled;
 
+      /* Unconditionally enable all G_MESSAGES_DEBUG domains, or GLib's default
+       * log handler will drop all our output. We don't spawn any subprocesses,
+       * so this shouldn't leak and cause problems elsewhere. */
+      Environment.set_variable ("G_MESSAGES_DEBUG", "all", true);
+
       return retval;
     }