I'm looking for a
Perl::Critic policy related to
Log::Log4perl. The policy should require every logging statement to be surrounded by a conditional testing for the given log level, as shown
here. Running
Devel::NYTProf has shown that this code, as noted by the
Log::Log4perl module's author, can have a
significant negative impact on performance.
# Correct:
if($logger->is_error()) {
$logger->error("Erroneous array: @super_long_array");
}
# Wrong - should emit a Perl::Critic warning
$logger->error("Erroneous array: @super_long_array");
Does such a policy exist? If not, are there policies that are similar that I can base this new one on?
--
No matter how great and destructive your problems may seem now, remember, you've probably only seen the tip of them. [1]
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.