[jboss-jira] [JBoss JIRA] (LOGTOOL-89) Add a level check for loggers before executing transform operations

James Perkins (JIRA) issues at jboss.org
Wed Apr 22 12:38:33 EDT 2015


    [ https://issues.jboss.org/browse/LOGTOOL-89?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13061635#comment-13061635 ] 

James Perkins edited comment on LOGTOOL-89 at 4/22/15 12:38 PM:
----------------------------------------------------------------

Wraps all log statements in a {{if (log.isEnabled(level))}} statement.


was (Author: jamezp):
Wraps all log statements in a {{if (log.isEnabled(level)}} statement.

> Add a level check for loggers before executing transform operations
> -------------------------------------------------------------------
>
>                 Key: LOGTOOL-89
>                 URL: https://issues.jboss.org/browse/LOGTOOL-89
>             Project: Log Tool
>          Issue Type: Enhancement
>            Reporter: James Perkins
>            Assignee: James Perkins
>
> Current example:
> {code:java|title=Interface}
>     @LogMessage
>     @Message(HASH_CODE_MSG)
>     void logClassHashCode(@Transform({TransformType.GET_CLASS, TransformType.HASH_CODE}) String s);
> {code}
> {code:java|title=Generated}
>     @Override
>     public final void logClassHashCode(final java.util.Collection c) {
>         final int cHashCode;
>         if (c == null) cHashCode = 0;
>         else cHashCode = c.getClass().hashCode();
>         log.logf(FQCN, org.jboss.logging.Logger.Level.INFO, null, logClassHashCode$str(), cHashCode);
>     }
> {code}
> The generated could should do a level check and only create the hashes if it's loggable.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


More information about the jboss-jira mailing list