I use log4cxx for logging. However, logging may introduce some performance overhead which I need to minimize.
How do I turn off logging (at runtime or compile time) so that the overhead is minimized - short of removing all log statements from the code?
The documentation states that
The user should be aware of the following performance issues.
Logging performance when logging is turned off.
When logging is turned off entirely or just for a set of levels, the cost of a log request consists of a method invocation plus an integer comparison. The LOG4CXX_DEBUG and similar macros suppress unnecessary expression evaluation if the request is not enabled.
But how to turn it off entirely? Is this the minimum overhead that can be achieved?