[gimp] libgimp: make GIMP_PLUGIN_DEBUG messages always visible again



commit e4f24a539e10a25a3239b8e7e3b391914561adc0
Author: Michael Natterer <mitch gimp org>
Date:   Sat Feb 23 16:10:19 2013 +0100

    libgimp: make GIMP_PLUGIN_DEBUG messages always visible again
    
    by adding "LibGimp" to G_MESSAGES_DEBUG so it doesn't get filtered
    away by newer GLib.

 libgimp/gimp.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/libgimp/gimp.c b/libgimp/gimp.c
index 30b2a84..0f6e386 100644
--- a/libgimp/gimp.c
+++ b/libgimp/gimp.c
@@ -336,6 +336,8 @@ gimp_main (const GimpPlugInInfo *info,
 
   if (env_string)
     {
+      const gchar *debug_messages;
+
       debug_string = strchr (env_string, ',');
 
       if (debug_string)
@@ -355,6 +357,20 @@ gimp_main (const GimpPlugInInfo *info,
         {
           gimp_debug_flags = GIMP_DEBUG_DEFAULT;
         }
+
+      /*  make debug output visible by setting G_MESSAGES_DEBUG  */
+      debug_messages = g_getenv ("G_MESSAGES_DEBUG");
+
+      if (debug_messages)
+        {
+          gchar *tmp = g_strconcat (debug_messages, ",LibGimp", NULL);
+          g_setenv ("G_MESSAGES_DEBUG", tmp, TRUE);
+          g_free (tmp);
+        }
+      else
+        {
+          g_setenv ("G_MESSAGES_DEBUG", "LibGimp", TRUE);
+        }
     }
 
   g_free (basename);


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