Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

My personal take is that any logging beyond errors(*) and warnings(*) is pointless.

The only purpose cutesy "informational" messages ("I opened a file", "I wrote to the file", "I closed the file"; etc.) serve, is as a program flow indicator, and as such, the only useful information they carry is the file&line number from which they are produced.

The only time logs are read is when something went wrong. Before that occurrence, informational messages are just clutter, that must be stored, and most time skipped over to find the useful information. And the program lines that produce them are program clutter and a performance drain. Extra, non-functional code that serves no good purpose, but that must be both written and maintained.

If you routinely write informational messages with enough, fine grained frequency to actually help locate where things go wrong, for 99% of the life of the program you are just producing crap that no one is interested in; but that must be written, maintained, stored and archived anyway. You've increased the size (and therefore complexity) of the program by 3 or 4 times; and are producing orders of magnitude of redundant output.

And if you are only producing sporadic broad strokes tracing, when things do go wrong it will not be enough to locate the problem. Trying to predict, when writing a program, where and what information will allow you to find future failures, would require a crystal ball; a pointless exercise.

The only meaningful option (IMO) for logging, beyond errors and warnings, is Devel::Trace style line by line tracing (though I think simple line numbers is better (all that is required) than full source text tracing); which can be turned on and off, on-demand, on a by-module basis.

(*)What constitutes an "error" and what a "warning" is another long debate.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re: Choosing a log level by BrowserUk
in thread Choosing a log level by stevieb

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-24 07:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found