in reply to Re: Balancing Logging and Code Readability
in thread Balancing Logging and Code Readability
Here is a performance tip for you:While this is all well and fine, it can't be changed in run-time. Log::Log4perl has a mechanism is_level that allows for reasonably high performance while allowing configuration changes in run-time (init_and_watch).use constant DEBUG => 1; print "this is debug" if DEBUG;
Benchmark your code and see if you can live with the penalty. Performance is not everything.$logger->debug("Erroneous array: @super_long_array") if($logger->is_debug());
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Balancing Logging and Code Readability
by Marshall (Canon) on Sep 23, 2009 at 08:58 UTC |