in reply to Log4perl: Using appropriate Log Levels
You could not put any logging into your utility subroutines (except debug logging) and instead throw an exception there. Catch that exception in the main subroutine (eval) and handle as appropriate. Your main subroutine is best set to know whether the action that just failed was trivial or very important and can log accordingly. This will also make it easier for you to decide how to classify your subroutines, first-class subroutines handle their errors, utility functions just throw exceptions.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Log4perl: Using appropriate Log Levels
by matt.tovey (Beadle) on Nov 24, 2005 at 15:13 UTC | |
by tirwhan (Abbot) on Nov 24, 2005 at 15:37 UTC |