camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-12004) Add LOG.isDebugEnabled() guard for LOG.debug()
Date Tue, 21 Nov 2017 08:08:01 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-12004?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16260393#comment-16260393
] 

ASF GitHub Bot commented on CAMEL-12004:
----------------------------------------

davsclaus commented on a change in pull request #2093: CAMEL-12004 Add isDebugEnabled() guard
for debug level logs
URL: https://github.com/apache/camel/pull/2093#discussion_r152200583
 
 

 ##########
 File path: camel-core/src/test/java/org/apache/camel/LanguageTestSupport.java
 ##########
 @@ -94,8 +94,9 @@ protected Object evaluateExpression(String expressionText, String expectedValue)
         } else {
             value = expression.evaluate(exchange, Object.class);
         }
-
-        log.debug("Evaluated expression: {} on exchange: {} result: {}", expression, exchange,
value);
+        if (log.isDebugEnabled()) {
 
 Review comment:
   This is not needed when using {}

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Add LOG.isDebugEnabled() guard for LOG.debug()
> ----------------------------------------------
>
>                 Key: CAMEL-12004
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12004
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Mehran Hassani
>            Priority: Minor
>              Labels: beginner, help-wanted
>
> I am conducting research on log related bugs. I tried to make a tool to fix repetitive
yet simple patterns of bugs that are related to logs. In these files, there are debug level
logging statements containing multiple string concatenation or method calls without the if
statement before them:
> camel-core/src/test/java/org/apache/camel/LanguageTestSupport.java, log.debug("Evaluated
expression: " + expression + " on exchange: " + exchange + " result: " + value);, 97
> components/camel-github/src/test/java/org/apache/camel/component/github/consumer/CommitConsumerTest.java,
log.debug("Got commit with author: " + author.getLogin() + ": " + author.getHtmlUrl() + "
SHA " + commit.getSha());, 62
> components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/QueueReplyManager.java,
log.debug("Using shared queue: " + endpoint.getReplyTo() + " with fixed message selector ["
+ fixedMessageSelector + "] as reply listener: " + answer);, 133
> components/camel-spring/src/main/java/org/apache/camel/spring/spi/TransactionErrorHandler.java,
log.debug("Transaction rollback (" + transactionKey + ") redelivered(" + redelivered + ")
for "+ ids + " due exchange was marked for rollbackOnlyLast and caught: ", cause);, 157
> components/camel-test/src/main/java/org/apache/camel/test/junit4/LanguageTestSupport.java,
log.debug("Evaluated expression: " + expression + " on exchange: " + exchange + " result:
" + value);, 88
> components/camel-testng/src/main/java/org/apache/camel/testng/LanguageTestSupport.java,
log.debug("Evaluated expression: " + expression + " on exchange: " + exchange + " result:
" + value);, 88
> tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java, getLog().debug("strange;
" + activeCount + " thread(s) still active in the group "+ threadGroup + " such as " + threadsArray[0]);,
652
> tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java, getLog().debug("Skipping
org.osgi.core -> " + classPathElement.getGroupId() + "/" + classPathElement.getArtifactId()
+ "/" + classPathElement.getVersion());, 761
> tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageDataFormatMojo.java,
log.debug("Generated " + out + " containing JSon schema for " + name + " data format");, 218
> tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageHelper.java,
log.debug("checking  if " + path + " (" + r.getDirectory() + "/" + suffix + ") has changed.");,
48
> tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageLanguageMojo.java,
log.debug("Generated " + out + " containing JSon schema for " + name + " language");, 215
> tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootStarterMojo.java,
getLog().debug("Found dependency node: " + artifact.getGroupId() + ":" + artifact.getArtifactId()
+ ":" + artifact.getVersion() + " - scope=" + artifact.getScope());, 401
> tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java,
getLog().debug("strange; " + activeCount + " thread(s) still active in the group "+ threadGroup
+ " such as " + threadsArray[0]);, 515
> Would you be interested in adding the if before these logging statements?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message