|We don't bite newbies here... much|
Re: Choosing a log levelby BrowserUk (Patriarch)
|on Mar 29, 2017 at 11:49 UTC ( #1186364=note: 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 Section Seekers of Perl Wisdom