Re: [Dev] Optimizing the log.isDebugEnabled()

2015-08-27 Thread Malaka Silva
In the given example, the log message is a constant string, so letting the logger discard it is just as efficient as checking whether the logger is enabled, and it lowers the complexity of the code because there are fewer branches. However it is worth adding the log.isDebugEnabled() in case

[Dev] Optimizing the log.isDebugEnabled()

2015-08-26 Thread Vanjikumaran Sivajothy
Hi Devs, I have seen most of the code in the WSO2 code repo is making use of log.isDebugEnabled() [1] every time before it debug log. Why do not we introduce a instance variable and make use of that variable to check the debug flag? [1] if (*log.isDebugEnabled()*) { log.debug(Log XX);

Re: [Dev] Optimizing the log.isDebugEnabled()

2015-08-26 Thread Afkham Azeez
Yes, but it won't improve the performance a great deal On Aug 27, 2015 5:21 AM, Vanjikumaran Sivajothy va...@wso2.com wrote: Hi Devs, I have seen most of the code in the WSO2 code repo is making use of log.isDebugEnabled() [1] every time before it debug log. Why do not we introduce a