On Sun, 10 Dec 2000, Michael A. Nachbaur wrote:

> I'm starting a rather large project right now, and I want to make debugging
> as easy as possible for me.  The only way I know of debugging under mod_perl
> is the typical 'print STDERR foo' technique.  There must be a better way
> then that, whether automating the 'print STDERR', or giving me logs of what
> was called when (doubtful).

You can do the normal -d debug under mod_perl, see:
http://perl.apache.org/guide/debug.html

BTW, has anyone came with a solution for ptkdb to work more than once
under mod_perl? The author has never replied to my inqueries :( 

> Basically, I was thinking of having something like syslog, but for my perl
> modules.  I'd also like to be able to limit the debugging output on a
> per-module basis.  Anyone know of anything like this, before I build one?

package Foo;
use constant DEBUG => 1;
...
warn "foo" if DEBUG;
...

package Bar;
use constant DEBUG => 0;
...
warn "bar" if DEBUG;
...

you get the idea... Only warns in Foo will work...

you can keep the debug statements in the code without having any overhead
of doing if DEBUG, since they are stripped at compile time.


_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://logilune.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/  


Reply via email to