Yes, but it won't improve the performance a great deal
On Aug 27, 2015 5:21 AM, "Vanjikumaran Sivajothy" <[email protected]> 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 instance variable and make use of that variable
> to check the debug flag?
>
>
>
>
> [1]
> if (*log.isDebugEnabled()*) {
>  log.debug("Log XXXXXX");
> }
> if (*log.isDebugEnabled()*) {
>  log.debug("Log YYYYYY");
> }
>
>
> [2]
> boolean isDebugEnabled = *log.isDebugEnabled();*
> if (isDebugEnabled) {
>  log.debug("Log XXXXXX");
> }
> if (isDebugEnabled) {
>  log.debug("Log YYYYYY");
> }
>
> --
> Vanjikumaran Sivajothy
> *Associate Technical Lead*
> *WSO2 Inc. http://wso2.com <http://wso2.com/>*
> *USA Mobile **+1-812-361-1286*
> *Srilanka Mobile:+94-777-219-209*
> [image: Facebook] <https://www.facebook.com/vanjikumaran> [image: Twitter]
> <https://twitter.com/vanjikumaran> [image: LinkedIn]
> <http://www.linkedin.com/pub/vanjikumaran-sivajothy/25/b31/293> [image:
> Blogger] <http://vanjikumaran.blogspot.com/> [image: SlideShare]
> <http://www.slideshare.net/vanjikumaran>
>
> This communication may contain privileged or other
> confidential information and is intended exclusively for the addressee/s.
> If you are not the intended recipient/s, or believe that you may
> have received this communication in error, please reply to the
> sender indicating that fact and delete the copy you received and in
> addition, you should not print, copy, re-transmit, disseminate, or
> otherwise use the information contained in this communication.
> Internet communications cannot be guaranteed to be timely, secure, error
> or virus-free. The sender does not accept liability for any errors
> or omissions
>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to