liz has asked for the wisdom of the Perl Monks concerning the following question:
The documentation says:
Packages claim that there won't be errors on calls to or from packages explicitly marked as safe by inclusion in @CARP_NOT, or (if that array is empty) @ISA.
Ok, so I added:
to my Log::Dispatch::Perl code. But a Carp::confess still lists levels with these modules:our @CARP_NOT = ('Log::Dispatch::Output','Log::Dispatch');
use Log::Dispatch::Perl; my $dispatcher = Log::Dispatch->new; my $channel = Log::Dispatch::Perl->new( qw(name default min_level debu +g) ); $dispatcher->add( $channel ); $dispatcher->alert( 'This is an alert' ); __END__ This is an alert Log::Dispatch::Output::log('undef','level','alert','name','def +ault','message','This is an alert') called at /usr/local/lib/perl5/si +te_perl/5.8.3/Log/Dispatch.pm line 95 Log::Dispatch::_log_to('Log::Dispatch=HASH(0xfc578)','level',' +alert','name','default','message','This is an alert') called at /usr/ +local/lib/perl5/site_perl/5.8.3/Log/Dispatch.pm line 74 Log::Dispatch::log('Log::Dispatch=HASH(0xfc578)','level','aler +t','message','This is an alert') called at /usr/local/lib/perl5/site_ +perl/5.8.3/Log/Dispatch.pm line 22 Log::Dispatch::__ANON__('Log::Dispatch=HASH(0xfc578)','This is + an alert') called at line 7
What am I missing?
Liz
Update:
Thanks ysth for the feedback. In the end, it has come to removing the first 4 lines from Carp::longmess. The actual regexp to remove the first 4 lines will become s#^(?:[^\n]*\n){4}##s. New version of Log::Dispatch::Perl is on its way to CPAN.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to lose Carp levels with @CARP_NOT?
by ysth (Canon) on Jan 28, 2004 at 21:47 UTC | |
by liz (Monsignor) on Jan 28, 2004 at 21:59 UTC | |
by ysth (Canon) on Jan 28, 2004 at 22:35 UTC | |
|
Re: How to lose Carp levels with @CARP_NOT?
by tilly (Archbishop) on Jan 29, 2004 at 16:23 UTC | |
by liz (Monsignor) on Jan 29, 2004 at 16:52 UTC | |
by tilly (Archbishop) on Jan 29, 2004 at 19:13 UTC |