From eb320f41e1089202bf1e03c6f220b364a2e8be61 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Mon, 12 Sep 2016 11:01:40 +0100 Subject: [PATCH] add VIPS_TRACE env var to enable --vips-cache-trace --- libvips/iofuncs/cache.c | 3 +++ libvips/iofuncs/init.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libvips/iofuncs/cache.c b/libvips/iofuncs/cache.c index 26f6b7b4..c2393e2e 100644 --- a/libvips/iofuncs/cache.c +++ b/libvips/iofuncs/cache.c @@ -1010,6 +1010,9 @@ vips_cache_set_dump( gboolean dump ) * * Handy for debugging. Print operation cache actions to stdout as we run. * + * You can set the environment variable `VIPS_TRACE` to turn this option on, or + * use the command-line flag `--vips-cache-trace`. + * * See also: vips_cache_set_dump(). */ void diff --git a/libvips/iofuncs/init.c b/libvips/iofuncs/init.c index 7398374e..403dd527 100644 --- a/libvips/iofuncs/init.c +++ b/libvips/iofuncs/init.c @@ -328,11 +328,13 @@ vips_init( const char *argv0 ) bindtextdomain( GETTEXT_PACKAGE, name ); bind_textdomain_codeset( GETTEXT_PACKAGE, "UTF-8" ); - /* Default info setting from env. + /* Default various settings from env. */ if( g_getenv( "VIPS_INFO" ) || g_getenv( "IM_INFO" ) ) vips_info_set( TRUE ); + if( g_getenv( "VIPS_TRACE" ) ) + vips_cache_set_trace( TRUE ); /* Register base vips types. */