Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Perl::Critic policy for common Log::Log4perl mistake

by mje (Curate)
on Nov 10, 2011 at 16:07 UTC ( #937401=note: print w/ replies, xml ) Need Help??


in reply to Perl::Critic policy for common Log::Log4perl mistake

I wouldn't bother doing the check first, I just change the code to:

$logger->error(sub {"Erroneous array: @super_long_array"});

then I believe it does not get expanded until inside Log::Log4perl when it decides to log or not.

So now all you need is a Perl Critic rule for using sub {} in logging ;-)


Comment on Re: Perl::Critic policy for common Log::Log4perl mistake
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (19)
As of 2015-07-07 21:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls