[gimp] app: make GimpBrushCache debug spew depend on GIMP_LOG=brush-cache



commit a83876040de71606cc9b2ed2db6ab47fe7390853
Author: Michael Natterer <mitch gimp org>
Date:   Wed Apr 6 09:15:50 2011 +0200

    app: make GimpBrushCache debug spew depend on GIMP_LOG=brush-cache

 app/core/gimpbrushcache.c |    7 +++++--
 app/gimp-log.c            |    3 ++-
 app/gimp-log.h            |    4 +++-
 3 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/app/core/gimpbrushcache.c b/app/core/gimpbrushcache.c
index 2afcdc1..138d0ce 100644
--- a/app/core/gimpbrushcache.c
+++ b/app/core/gimpbrushcache.c
@@ -26,6 +26,7 @@
 
 #include "gimpbrushcache.h"
 
+#include "gimp-log.h"
 #include "gimp-intl.h"
 
 
@@ -193,12 +194,14 @@ gimp_brush_cache_get (GimpBrushCache *cache,
       cache->last_angle        == angle        &&
       cache->last_hardness     == hardness)
     {
-      g_printerr ("%c", cache->debug_hit);
+      if (gimp_log_flags & GIMP_LOG_BRUSH_CACHE)
+        g_printerr ("%c", cache->debug_hit);
 
       return (gconstpointer) cache->last_data;
     }
 
-  g_printerr ("%c", cache->debug_miss);
+  if (gimp_log_flags & GIMP_LOG_BRUSH_CACHE)
+    g_printerr ("%c", cache->debug_miss);
 
   return NULL;
 }
diff --git a/app/gimp-log.c b/app/gimp-log.c
index 47a98e2..182b3c6 100644
--- a/app/gimp-log.c
+++ b/app/gimp-log.c
@@ -55,7 +55,8 @@ gimp_log_init (void)
         { "key-events",         GIMP_LOG_KEY_EVENTS         },
         { "auto-tab-style",     GIMP_LOG_AUTO_TAB_STYLE     },
         { "instances",          GIMP_LOG_INSTANCES          },
-        { "rectangle-tool",     GIMP_LOG_RECTANGLE_TOOL     }
+        { "rectangle-tool",     GIMP_LOG_RECTANGLE_TOOL     },
+        { "brush-cache",        GIMP_LOG_BRUSH_CACHE        }
       };
 
       /*  g_parse_debug_string() has special treatment of the string 'help',
diff --git a/app/gimp-log.h b/app/gimp-log.h
index f74f44c..0256531 100644
--- a/app/gimp-log.h
+++ b/app/gimp-log.h
@@ -38,7 +38,8 @@ typedef enum
   GIMP_LOG_KEY_EVENTS         = 1 << 14,
   GIMP_LOG_AUTO_TAB_STYLE     = 1 << 15,
   GIMP_LOG_INSTANCES          = 1 << 16,
-  GIMP_LOG_RECTANGLE_TOOL     = 1 << 17
+  GIMP_LOG_RECTANGLE_TOOL     = 1 << 17,
+  GIMP_LOG_BRUSH_CACHE        = 1 << 18
 } GimpLogFlags;
 
 
@@ -97,6 +98,7 @@ void   gimp_logv     (const gchar *function,
 #define AUTO_TAB_STYLE     GIMP_LOG_AUTO_TAB_STYLE
 #define INSTANCES          GIMP_LOG_INSTANCES
 #define RECTANGLE_TOOL     GIMP_LOG_RECTANGLE_TOOL
+#define BRUSH_CACHE        GIMP_LOG_BRUSH_CACHE
 
 #if 0 /* last resort */
 #  define GIMP_LOG /* nothing => no varargs, no log */



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