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

This commit is contained in:
Michael Natterer 2011-04-06 09:15:50 +02:00
parent 0315f483e6
commit a83876040d
3 changed files with 10 additions and 4 deletions

View file

@ -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;
}

View file

@ -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',

View file

@ -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 */