in reply to Re: What module do you like for debugging CGI scripts
in thread What module do you like for debugging CGI scripts

I took a look at CGI::Carp and it does not support the ability to specify the level of log msg that you want output. I also don't see a way to switch off logging altogether when in a production environment.
  • Comment on Re^2: What module do you like for debugging CGI scripts

Replies are listed 'Best First'.
Re^3: What module do you like for debugging CGI scripts
by rinceWind (Monsignor) on Jan 28, 2007 at 09:54 UTC

    You don't want to turn off the logging altogether in a production environment, merely not to send the output to the browser. CGI::Carp will, by default, send the output to stderr, hence to the server log, which you do want in a production environment.

    The following snippet should help:

    BEGIN { my $carp_arg; if ($ENV{ENV} =~ /DEV/) { # or some other test for a non producti +on env $carp_arg = 'fatalsToBrowser'; } use CGI::Carp $carp_arg; }

    --

    Oh Lord, won’t you burn me a Knoppix CD ?
    My friends all rate Windows, I must disagree.
    Your powers of persuasion will set them all free,
    So oh Lord, won’t you burn me a Knoppix CD ?
    (Missquoting Janis Joplin)

Re^3: What module do you like for debugging CGI scripts
by f00li5h (Chaplain) on Jan 28, 2007 at 08:14 UTC

    Surely there are no bugs in the code you're running on your production environment ;)

    Also, if you have  if $DEBUG attached to the end of all your calls to warn then they'll just disappear when you set $DEBUG=undef

    @_=qw; ask f00li5h to appear and remain for a moment of pretend better than a lifetime;;s;;@_[map hex,split'',B204316D8C2A4516DE];;y/05/os/&print;
Re^3: What module do you like for debugging CGI scripts
by spatterson (Pilgrim) on Jan 29, 2007 at 12:38 UTC
    Just don't load the module in production, though you may want to adjust your web server (apache) to show better pages on 500 code errors.

    just another cpan module author