This does not really have anything to do with Perl, but I suspect that some of you may have encountered a similar problem.

I have a module with a few subroutines which contain the main logic and several utility subroutines which do more or less trivial things. What I offen find happening is that a utility sub will produce an ERROR in the log and then the sub which called it will also log an ERROR, because the utility sub did not produce the expected result. In principle, I would prefer to only see the second ERROR and could just let the utility sub log, say, WARN. However, as the module get more complex, the distinction between 'main logic' sub and 'utility' sub seems to become less clear, and thus it seems more difficult to say what the appropriate log level should be.

I suspect the answer lies in breaking down the module into smaller modules, thus forcing myself to distinguish between different categories of sub, so that I can turn logging on and off for each module separately, but perhaps some of you have other ideas.

Thanks,

loris


"It took Loris ten minutes to eat a satsuma . . . twenty minutes to get from one end of his branch to the other . . . and an hour to scratch his bottom. But Slow Loris didn't care. He had a secret . . ."

In reply to Log4perl: Using appropriate Log Levels by loris

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.