camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <>
Subject [jira] [Commented] (CAMEL-3759) After switching to slf4j, we can get rid of the 'isTraceEnabled', 'isDebugEnabled' and 'isInfoEnabled' statements
Date Fri, 08 Apr 2011 06:46:05 GMT


Claus Ibsen commented on CAMEL-3759:

Christian you cannot just do this everywhere. The single line is only possible if the parameters
is not to be computed or creating new objects.

So the ones who creates a new Object[] for the parameters etc, should still be guarded with
the isDebugEnabled etc.
Also some of the operations on the parameters may take time to compute, so its really not
always a good idea.

IMHO the isXXX should be used when the parameters are not simple and if they invoke operations
to get data (and the operation is not a simple getter, the compiler can inline).

> After switching to slf4j, we can get rid of the 'isTraceEnabled', 'isDebugEnabled' and
'isInfoEnabled' statements
> -----------------------------------------------------------------------------------------------------------------
>                 Key: CAMEL-3759
>                 URL:
>             Project: Camel
>          Issue Type: Improvement
>    Affects Versions: 2.6.0
>            Reporter: Christian Müller
>            Assignee: Christian Müller
>             Fix For: 2.8.0, 3.0.0
> we can get rid of the 'isTraceEnabled', 'isDebugEnabled' and 'isInfoEnabled' statements
with slf4j and use
> {code}
> logger.debug("Temperature set to {}. Old temperature was {}.", t, oldT);
> {code}
> instead
> christian-muellers-macbook-pro:camel cmueller$ egrep -r 'isTraceEnabled|isDebugEnabled|isInfoEnabled]'
. | wc -l
>     1485

This message is automatically generated by JIRA.
For more information on JIRA, see:

View raw message