Mike Schilli wrote:
> Hey all,
>
> "kid on grok" (think that's J.C.) suggested to rename l4p's internal
> debug constants from DEBUG to _INTERNAL_DEBUG to avoid confusion with
> the function DEBUG() or the constant $DEBUG. Checked in.
>
> --
> -- Mike
> Mike Schilli
Mike,
I went ahead and did this on my tree:
find . -exec perl -pi.bak -e's/use constant DEBUG =>/our
\$_internal_DEBUG =/' {} \;
find . -exec perl -pi -e's/if DEBUG/if \$_internal_DEBUG/' {} \;
other than complaints when trying to inplace-edit directories,
it worked (compiles and runs, havent checked in detail).
now I can override constants (for convenience) from test-scripts.
ala
$Log::Log4perl::_internal_DEBUG = 1;
$Log::Log4perl::Appender::_internal_DEBUG = 0;
$Log::Log4perl::Config::_internal_DEBUG = 1;
$Log::Log4perl::Filter::_internal_DEBUG = 0;
$Log::Log4perl::JavaMap::_internal_DEBUG = 0;
$Log::Log4perl::Logger::_internal_DEBUG = 0;
$Log::Log4perl::Config::DOMConfigurator::_internal_DEBUG = 0;
$Log::Log4perl::Config::Watch::_internal_DEBUG = 0;
$Log::Log4perl::Filter::Boolean::_internal_DEBUG = 0;
$Log::Log4perl::Filter::LevelMatch::_internal_DEBUG = 0;
$Log::Log4perl::Filter::LevelRange::_internal_DEBUG = 0;
$Log::Log4perl::Filter::StringMatch::_internal_DEBUG = 0;
$Log::Log4perl::JavaMap::TestBuffer::_internal_DEBUG = 0;
Im sure this will hurt performance by defeating compile-time optimization,
and in any case, you may not want to expose the variables this way,
so feel free to not accept these changes.
and my apologies, I should have just done this 1st, rather than bother you.
|