cutlass2006 has asked for the wisdom of the Perl Monks concerning the following question:
to make debugging easy, I would like to do any of the following to turn debugging on or off, specifically in a mod_perl deployed application;
I note in 2001, that this was discussed before.
My questions are thus;
thanks in advance
updateThank you for the advice, I decided to go down the following route to get what I wanted; e.g. flexible logging, with assertions and DEBUG flag... with a roughly accurate timing mechanism.
use Benchmark::Stopwatch; use Log::Log4perl; use Carp::Assert; *ADEBUG = *DEBUG; undef *DEBUG;
the DEBUG constant is defined by both Log::Log4perl and Carp::Assert ... so I had to redefine it.
With this setup, I can reuse Carp::Assert PERL_NDEBUG env variable for controlling execution of DEBUG statements and assertions. This is easily set in either Apache using PerlSetEnv directive or setting/exporting environment variable on underlying OS
I also included benchmarking, which activates only if DEBUG is enabled
$stopwatch = Benchmark::Stopwatch->new->start if DEBUG;
update 2 I now find that Devel::NYTProf::Apache can completely replace this approach in mod_perl apps
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DEBUG redux (use, ::)
by tye (Sage) on Jun 03, 2008 at 14:48 UTC |