Extraneous logging can be expensive. Therefore, I could turn off logging or heighten the logging threshold level to reduce logging during production mode (everybody knows that!)
However, what about the routines that are called to supply parameters to the logger statement?
Consider the logger statement.
logger.info("number of windows="+wins.size());
where wins.size() is an excruciatingly expensive operation - say, just for illustration of my (mis)understanding the problem.
If info logging is turned off, would wins.size() still be run.
Because when I do debugging, it seems that wins.size() gets stepped over first before log.info(). If so, what are your strategies to prevent expensive functions inside a logger statement from being executed if the logger is turned off?