loris has asked for the wisdom of the Perl Monks concerning the following question:
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,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Log4perl: Using appropriate Log Levels
by tirwhan (Abbot) on Nov 24, 2005 at 09:33 UTC | |
by matt.tovey (Beadle) on Nov 24, 2005 at 15:13 UTC | |
by tirwhan (Abbot) on Nov 24, 2005 at 15:37 UTC |