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

Cannot you just create a new package inheriting from Log::Log4perl that wraps each call to error into is_error check?
  • Comment on Re: Perl::Critic policy for common Log::Log4perl mistake

Replies are listed 'Best First'.
Re^2: Perl::Critic policy for common Log::Log4perl mistake
by saberworks (Curate) on Nov 08, 2011 at 18:43 UTC
    No because the string will be interpolated on the way in, so you won't avoid the hit. The only way to avoid the hit is to ensure the string never gets interpolated in the first place (it's not the log call that's slow, it's the string interpolation of a huge array).