From: Vincent Pit Date: Tue, 18 Aug 2015 13:44:41 +0000 (-0300) Subject: Only dump debug info when $Scope::Upper::DEBUG is true X-Git-Tag: v0.28~2 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FScope-Upper.git;a=commitdiff_plain;h=c8b3fd1af4c37a5d52756381215a5d4117b5b44f Only dump debug info when $Scope::Upper::DEBUG is true --- diff --git a/Upper.xs b/Upper.xs index f85cc54..823b32e 100644 --- a/Upper.xs +++ b/Upper.xs @@ -54,9 +54,12 @@ # define SU_D(X) STMT_START X STMT_END static void su_debug_log(const char *fmt, ...) { va_list va; + SV *sv; dTHX; va_start(va, fmt); - PerlIO_vprintf(Perl_debug_log, fmt, va); + sv = get_sv(__PACKAGE__ "::DEBUG", 0); + if (sv && SvTRUE(sv)) + PerlIO_vprintf(Perl_debug_log, fmt, va); va_end(va); return; }