Log::Log4perl and (supposed) performance penalties

Log::Log4perl – Log4j implementation for Perl – metacpan.org

Evaluating parameters to logger methods may be expensive, but that’s outside the scope and responsibility of Log::Log4perl. So if you know that you have “expensive parameters”, you may “guard” your logger calls with “…->is_…()” method calls. Otherwise just don’t do so! It does not make sense. Read up the above manual page section! Why should the is_trace call be cheaper than the trace call itself? Of course it’s not. I guess, you got that.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: