Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Log::Log4Perl best practices

by bl0rf (Pilgrim)
on Jun 01, 2004 at 00:43 UTC ( #357887=note: print w/ replies, xml ) Need Help??


in reply to Log::Log4Perl best practices

Try putting

use Log::Log4perl qw(:levels); Log::Log4perl::init('/home/code/log4perl-conf.txt'); my $logger = Log::Log4perl->get_logger($0); $SIG{__DIE__} = sub {$Log::Log4perl::caller_depth++; $logger->fatal('f +atal: ', @_); die @_;};
into a separate module, that doesn't have a separate package. Then include only that module in your scripts, this should reduce the extra code to a single use..blah.. statement.


Comment on Re: Log::Log4Perl best practices
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://357887]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2014-11-27 11:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (184 votes), past polls