[jira] Created: (JCI-46) Add Guard conditions to logging statements

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (JCI-46) Add Guard conditions to logging statements

ASF GitHub Bot (Jira)
Add Guard conditions to logging statements
------------------------------------------

                 Key: JCI-46
                 URL: https://issues.apache.org/jira/browse/JCI-46
             Project: Commons JCI
          Issue Type: Improvement
          Components: compiler eclipse, compiler groovy, compiler janino, compiler javac, compiler jsr199, compiler jython, compiler rhino, core, fam
    Affects Versions: 1.0RC2
            Reporter: Niall Pemberton
            Priority: Minor


The lack of Guard conditions on logging statements that concatenate objects to create the logging output results in unecessary StringBuffer creation when the logging level is below the threshold set.

Would be a good idea IMO to change statements like:

    log.debug(getId() + " found class: " + name  + " (" + clazzBytes.length + " bytes)");

to

    if (log.isDebugEnabled()) {
        log.debug(getId() + " found class: " + name  + " (" + clazzBytes.length + " bytes)");
    }



--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (JCI-46) Add Guard conditions to logging statements

ASF GitHub Bot (Jira)

     [ https://issues.apache.org/jira/browse/JCI-46?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Torsten Curdt closed JCI-46.
----------------------------

    Resolution: Won't Fix

https://issues.apache.org/jira/browse/JCI-49

> Add Guard conditions to logging statements
> ------------------------------------------
>
>                 Key: JCI-46
>                 URL: https://issues.apache.org/jira/browse/JCI-46
>             Project: Commons JCI
>          Issue Type: Improvement
>          Components: compiler eclipse, compiler groovy, compiler janino, compiler javac, compiler jsr199, compiler jython, compiler rhino, core, fam
>    Affects Versions: 1.0RC2
>            Reporter: Niall Pemberton
>            Priority: Minor
>
> The lack of Guard conditions on logging statements that concatenate objects to create the logging output results in unecessary StringBuffer creation when the logging level is below the threshold set.
> Would be a good idea IMO to change statements like:
>     log.debug(getId() + " found class: " + name  + " (" + clazzBytes.length + " bytes)");
> to
>     if (log.isDebugEnabled()) {
>         log.debug(getId() + " found class: " + name  + " (" + clazzBytes.length + " bytes)");
>     }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]