camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmuel...@apache.org
Subject svn commit: r1089960 [1/2] - in /camel/trunk/camel-core/src/main/java/org/apache/camel: builder/xml/ component/bean/ component/dataset/ component/file/ component/file/strategy/ component/language/ component/mock/ component/properties/ component/seda/ i...
Date Thu, 07 Apr 2011 19:46:00 GMT
Author: cmueller
Date: Thu Apr  7 19:45:57 2011
New Revision: 1089960

URL: http://svn.apache.org/viewvc?rev=1089960&view=rev
Log:
CAMEL-3759: After switching to slf4j, we can get rid of the 'isTraceEnabled', 'isDebugEnabled' and 'isInfoEnabled' statements - work in progress

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XsltUriResolver.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetEndpoint.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileOnCompletion.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileProducer.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/FileChangedExclusiveReadLockStrategy.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/FileLockExclusiveReadLockStrategy.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/GenericFileProcessStrategySupport.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/MarkerFileExclusiveReadLockStrategy.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/language/LanguageProducer.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/TimeClause.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/CamelPostProcessorHelper.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ConsumerCache.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponent.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponentResolver.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultConsumer.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExecutorServiceStrategy.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultLanguageResolver.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultPackageScanClassResolver.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultProducer.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultServicePool.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/InterceptSendToEndpoint.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/LimitedPollingConsumerPollStrategy.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ProducerCache.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/RoutePolicySupport.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/RouteService.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollConsumer.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/AnnotationTypeConverterLoader.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/language/simple/SimpleLanguageSupport.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/management/DefaultManagementAgent.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/management/PublishEventNotifier.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/RouteDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/TransactedDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/BatchProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ChoiceProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DefaultChannel.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DelayProcessorSupport.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/FilterProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/LoopProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/OnCompletionProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Pipeline.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/PipelineHelper.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/PollEnricher.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RedeliveryPolicy.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/SendProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/TryProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/WireTapProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/idempotent/FileIdempotentRepository.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/idempotent/IdempotentConsumer.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/idempotent/IdempotentOnCompletion.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/loadbalancer/FailOverLoadBalancer.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/validation/PredicateValidatingProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/util/DefaultTimeoutMap.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/util/EndpointHelper.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/util/EventHelper.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/util/FileUtil.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/util/ServiceHelper.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XsltUriResolver.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XsltUriResolver.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XsltUriResolver.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XsltUriResolver.java Thu Apr  7 19:45:57 2011
@@ -61,9 +61,7 @@ public class XsltUriResolver implements 
         LOG.trace("Resolving URI with href: {} and base: {}", href, base);
 
         if (href.startsWith("classpath:")) {
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("Resolving URI from classpath: " + href);
-            }
+            LOG.debug("Resolving URI from classpath: {}", href);
 
             String name = ObjectHelper.after(href, ":");
             InputStream is = resolver.loadResourceAsStream(name);
@@ -74,9 +72,7 @@ public class XsltUriResolver implements 
         }
 
         if (href.startsWith("file:")) {
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("Resolving URI from file: " + href);
-            }
+            LOG.debug("Resolving URI from file: {}", href);
 
             String name = ObjectHelper.after(href, ":");
             File file = new File(name);

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java Thu Apr  7 19:45:57 2011
@@ -184,9 +184,7 @@ public class BeanInfo {
             return methodInfo.createMethodInvocation(pojo, exchange);
         }
 
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("Cannot find suitable method to invoke on bean: " + pojo);
-        }
+        LOG.debug("Cannot find suitable method to invoke on bean: {}", pojo);
         return null;
     }
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanProcessor.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanProcessor.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanProcessor.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanProcessor.java Thu Apr  7 19:45:57 2011
@@ -186,17 +186,13 @@ public class BeanProcessor extends Servi
         if (!invocation.getMethod().getReturnType().equals(Void.TYPE) && value != Void.TYPE) {
             if (exchange.getPattern().isOutCapable()) {
                 // force out creating if not already created (as its lazy)
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("Setting bean invocation result on the OUT message: " + value);
-                }
+                LOG.debug("Setting bean invocation result on the OUT message: {}", value);
                 exchange.getOut().setBody(value);
                 // propagate headers
                 exchange.getOut().getHeaders().putAll(exchange.getIn().getHeaders());
             } else {
                 // if not out then set it on the in
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("Setting bean invocation result on the IN message: " + value);
-                }
+                LOG.debug("Setting bean invocation result on the IN message: {}", value);
                 exchange.getIn().setBody(value);
             }
         }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetEndpoint.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetEndpoint.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetEndpoint.java Thu Apr  7 19:45:57 2011
@@ -190,8 +190,8 @@ public class DataSetEndpoint extends Moc
 
         // now lets assert that they are the same
         if (log.isDebugEnabled()) {
-            Integer dsi = actual.getIn().getHeader(Exchange.DATASET_INDEX, Integer.class);
-            log.debug("Received message: " + index + " (DataSet index=" + dsi + ") = " + actual);
+            log.debug("Received message: {} (DataSet index={}) = {}",
+                    new Object[]{index, actual.getIn().getHeader(Exchange.DATASET_INDEX, Integer.class), actual});
         }
 
         assertMessageExpected(index, expected, actual);

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java Thu Apr  7 19:45:57 2011
@@ -40,9 +40,7 @@ public class FileConsumer extends Generi
 
         File directory = new File(fileName);
         if (!directory.exists() || !directory.isDirectory()) {
-            if (log.isDebugEnabled()) {
-                log.debug("Cannot poll as directory does not exists or its not a directory: " + directory);
-            }
+            log.debug("Cannot poll as directory does not exists or its not a directory: {}", directory);
             if (getEndpoint().isDirectoryMustExist()) {
                 throw new GenericFileOperationFailedException("Directory does not exist: " + directory);
             }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java Thu Apr  7 19:45:57 2011
@@ -60,9 +60,7 @@ public class FileEndpoint extends Generi
         // auto create starting directory if needed
         if (!file.exists() && !isDirectory) {
             if (isAutoCreate()) {
-                if (log.isDebugEnabled()) {
-                    log.debug("Creating non existing starting directory: " + file);
-                }
+                log.debug("Creating non existing starting directory: {}", file);
                 boolean absolute = FileUtil.isAbsolute(file);
                 operations.buildDirectory(file.getPath(), absolute);
             } else if (isStartingDirectoryMustExist()) {

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java Thu Apr  7 19:45:57 2011
@@ -68,9 +68,7 @@ public abstract class GenericFileConsume
         // before we poll is there anything we need to check?
         // such as are we connected to the FTP Server still?
         if (!prePollCheck()) {
-            if (log.isDebugEnabled()) {
-                log.debug("Skipping poll as pre poll check returned false");
-            }
+            log.debug("Skipping poll as pre poll check returned false");
             return 0;
         }
 
@@ -83,14 +81,12 @@ public abstract class GenericFileConsume
         boolean limitHit = !pollDirectory(name, files);
         long delta = stop.stop();
         if (log.isDebugEnabled()) {
-            log.debug("Took " + TimeUtils.printDuration(delta) + " to poll: " + name);
+            log.debug("Took {} to poll: {}", TimeUtils.printDuration(delta), name);
         }
 
         // log if we hit the limit
         if (limitHit) {
-            if (log.isDebugEnabled()) {
-                log.debug("Limiting maximum messages to poll at " + maxMessagesPerPoll + " files as there was more messages in this poll.");
-            }
+            log.debug("Limiting maximum messages to poll at {} files as there was more messages in this poll.", maxMessagesPerPoll);
         }
 
         // sort files using file comparator if provided
@@ -113,8 +109,8 @@ public abstract class GenericFileConsume
 
         // consume files one by one
         int total = exchanges.size();
-        if (total > 0 && log.isDebugEnabled()) {
-            log.debug("Total " + total + " files to consume");
+        if (total > 0) {
+            log.debug("Total {} files to consume", total);
         }
 
         Queue<Exchange> q = exchanges;
@@ -135,9 +131,7 @@ public abstract class GenericFileConsume
 
         // limit if needed
         if (maxMessagesPerPoll > 0 && total > maxMessagesPerPoll) {
-            if (log.isDebugEnabled()) {
-                log.debug("Limiting to maximum messages to poll " + maxMessagesPerPoll + " as there was " + total + " messages in this poll.");
-            }
+            log.debug("Limiting to maximum messages to poll {} as there was {} messages in this poll.", maxMessagesPerPoll, total);
             total = maxMessagesPerPoll;
         }
 
@@ -275,9 +269,7 @@ public abstract class GenericFileConsume
 
             boolean begin = processStrategy.begin(operations, endpoint, exchange, file);
             if (!begin) {
-                if (log.isDebugEnabled()) {
-                    log.debug(endpoint + " cannot begin processing file: " + file);
-                }
+                log.debug(endpoint + " cannot begin processing file: {}", file);
                 // begin returned false, so remove file from the in progress list as its no longer in progress
                 endpoint.getInProgressRepository().remove(absoluteFileName);
                 return;
@@ -314,9 +306,7 @@ public abstract class GenericFileConsume
             // (for instance to move the file after we have processed it)
             exchange.addOnCompletion(new GenericFileOnCompletion<T>(endpoint, operations, target, absoluteFileName));
 
-            if (log.isDebugEnabled()) {
-                log.debug("About to process file: " + target + " using exchange: " + exchange);
-            }
+            log.debug("About to process file: {} using exchange: {}", target, exchange);
 
             // process the exchange using the async consumer to support async routing engine
             // which can be supported by this file consumer as all the done work is

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java Thu Apr  7 19:45:57 2011
@@ -124,9 +124,7 @@ public abstract class GenericFileEndpoin
     public GenericFileProcessStrategy<T> getGenericFileProcessStrategy() {
         if (processStrategy == null) {
             processStrategy = createGenericFileStrategy();
-            if (log.isDebugEnabled()) {
-                log.debug("Using Generic file process strategy: " + processStrategy);
-            }
+            log.debug("Using Generic file process strategy: {}", processStrategy);
         }
         return processStrategy;
     }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileOnCompletion.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileOnCompletion.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileOnCompletion.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileOnCompletion.java Thu Apr  7 19:45:57 2011
@@ -71,9 +71,7 @@ public class GenericFileOnCompletion<T> 
     protected void onCompletion(Exchange exchange) {
         GenericFileProcessStrategy<T> processStrategy = endpoint.getGenericFileProcessStrategy();
 
-        if (log.isDebugEnabled()) {
-            log.debug("Done processing file: " + file + " using exchange: " + exchange);
-        }
+        log.debug("Done processing file: {} using exchange: {}", file, exchange);
 
         // commit or rollback
         boolean committed = false;

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileProducer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileProducer.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileProducer.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileProducer.java Thu Apr  7 19:45:57 2011
@@ -238,9 +238,7 @@ public class GenericFileProducer<T> exte
             boolean absolute = FileUtil.isAbsolute(file);
             if (directory != null) {
                 if (!operations.buildDirectory(directory, absolute)) {
-                    if (log.isDebugEnabled()) {
-                        log.debug("Cannot build directory [" + directory + "] (could be because of denied permissions)");
-                    }
+                    log.debug("Cannot build directory [{}] (could be because of denied permissions)", directory);
                 }
             }
         }
@@ -252,9 +250,7 @@ public class GenericFileProducer<T> exte
         if (!success) {
             throw new GenericFileOperationFailedException("Error writing file [" + fileName + "]");
         }
-        if (log.isDebugEnabled()) {
-            log.debug("Wrote [" + fileName + "] to [" + getEndpoint() + "]");
-        }
+        log.debug("Wrote [{}] to [{}]", fileName, getEndpoint());
     }
 
     public String createFileName(Exchange exchange) {
@@ -268,17 +264,13 @@ public class GenericFileProducer<T> exte
             // the header name can be an expression too, that should override
             // whatever configured on the endpoint
             if (SimpleLanguage.hasStartToken(name)) {
-                if (log.isDebugEnabled()) {
-                    log.debug(Exchange.FILE_NAME + " contains a Simple expression: " + name);
-                }
+                log.debug("{} contains a Simple expression: {}", Exchange.FILE_NAME, name);
                 Language language = getEndpoint().getCamelContext().resolveLanguage("file");
                 expression = language.createExpression(name);
             }
         }
         if (expression != null) {
-            if (log.isDebugEnabled()) {
-                log.debug("Filename evaluated as expression: " + expression);
-            }
+            log.debug("Filename evaluated as expression: {}", expression);
             name = expression.evaluate(exchange, String.class);
         }
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/FileChangedExclusiveReadLockStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/FileChangedExclusiveReadLockStrategy.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/FileChangedExclusiveReadLockStrategy.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/FileChangedExclusiveReadLockStrategy.java Thu Apr  7 19:45:57 2011
@@ -93,9 +93,7 @@ public class FileChangedExclusiveReadLoc
                 // if not using timeout, then we cant retry, so rethrow
                 throw e;
             }
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("Cannot acquire read lock. Will try again.", e);
-            }
+            LOG.debug("Cannot acquire read lock. Will try again.", e);
             boolean interrupted = sleep();
             if (interrupted) {
                 // we were interrupted while sleeping, we are likely being shutdown so return false
@@ -112,9 +110,7 @@ public class FileChangedExclusiveReadLoc
             Thread.sleep(checkInterval);
             return false;
         } catch (InterruptedException e) {
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("Sleep interrupted while waiting for exclusive read lock, so breaking out");
-            }
+            LOG.debug("Sleep interrupted while waiting for exclusive read lock, so breaking out");
             return true;
         }
     }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/FileLockExclusiveReadLockStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/FileLockExclusiveReadLockStrategy.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/FileLockExclusiveReadLockStrategy.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/FileLockExclusiveReadLockStrategy.java Thu Apr  7 19:45:57 2011
@@ -97,9 +97,7 @@ public class FileLockExclusiveReadLockSt
                 // if not using timeout, then we cant retry, so rethrow
                 throw e;
             }
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("Cannot acquire read lock. Will try again.", e);
-            }
+            LOG.debug("Cannot acquire read lock. Will try again.", e);
             boolean interrupted = sleep();
             if (interrupted) {
                 // we were interrupted while sleeping, we are likely being shutdown so return false
@@ -129,9 +127,7 @@ public class FileLockExclusiveReadLockSt
             Thread.sleep(checkInterval);
             return false;
         } catch (InterruptedException e) {
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("Sleep interrupted while waiting for exclusive read lock, so breaking out");
-            }
+            LOG.debug("Sleep interrupted while waiting for exclusive read lock, so breaking out");
             return true;
         }
     }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/GenericFileProcessStrategySupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/GenericFileProcessStrategySupport.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/GenericFileProcessStrategySupport.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/GenericFileProcessStrategySupport.java Thu Apr  7 19:45:57 2011
@@ -92,9 +92,7 @@ public abstract class GenericFileProcess
             throw new GenericFileOperationFailedException("Cannot create directory: " + to.getParent() + " (could be because of denied permissions)");
         }
 
-        if (log.isDebugEnabled()) {
-            log.debug("Renaming file: " + from + " to: " + to);
-        }
+        log.debug("Renaming file: {} to: {}", from, to);
         boolean renamed = operations.renameFile(from.getAbsoluteFilePath(), to.getAbsoluteFilePath());
         if (!renamed) {
             throw new GenericFileOperationFailedException("Cannot rename file: " + from + " to: " + to);

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/MarkerFileExclusiveReadLockStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/MarkerFileExclusiveReadLockStrategy.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/MarkerFileExclusiveReadLockStrategy.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/MarkerFileExclusiveReadLockStrategy.java Thu Apr  7 19:45:57 2011
@@ -39,9 +39,7 @@ public class MarkerFileExclusiveReadLock
         String dir = endpoint.getConfiguration().getDirectory();
         File file = new File(dir);
 
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("Prepare on startup by deleting orphaned lock files from: " + dir);
-        }
+        LOG.debug("Prepare on startup by deleting orphaned lock files from: {}", dir);
 
         deleteLockFiles(file, endpoint.isRecursive());
     }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/language/LanguageProducer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/language/LanguageProducer.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/language/LanguageProducer.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/language/LanguageProducer.java Thu Apr  7 19:45:57 2011
@@ -49,9 +49,7 @@ public class LanguageProducer extends De
         ObjectHelper.notNull(exp, "expression");
 
         Object result = exp.evaluate(exchange, Object.class);
-        if (log.isDebugEnabled()) {
-            log.debug("Evaluated expression as: " + result + " with: " + exchange);
-        }
+        log.debug("Evaluated expression as: {} with: {}", result, exchange);
 
         // set message body if transform is enabled
         if (getEndpoint().isTransform()) {

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java Thu Apr  7 19:45:57 2011
@@ -1044,9 +1044,7 @@ public class MockEndpoint extends Defaul
         StopWatch watch = new StopWatch();
         waitForCompleteLatch(resultWaitTime);
         long delta = watch.stop();
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("Took " + delta + " millis to complete latch");
-        }
+        LOG.debug("Took {} millis to complete latch", delta);
 
         if (resultMinimumWaitTime > 0 && delta < resultMinimumWaitTime) {
             fail("Expected minimum " + resultMinimumWaitTime
@@ -1080,7 +1078,7 @@ public class MockEndpoint extends Defaul
             List<Exchange> list = getReceivedExchanges();
             int index = 0;
             for (Exchange exchange : list) {
-                LOG.debug(getEndpointUri() + " failed and received[" + (++index) + "]: " + exchange);
+                LOG.debug("{} failed and received[{}]: {}", new Object[]{getEndpointUri(), ++index, exchange});
             }
         }
         throw new AssertionError(getEndpointUri() + " " + message);

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/TimeClause.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/TimeClause.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/TimeClause.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/TimeClause.java Thu Apr  7 19:45:57 2011
@@ -164,7 +164,7 @@ public class TimeClause extends BinaryPr
         }
 
         if (LOG.isDebugEnabled()) {
-            LOG.debug("Evaluated time clause [" + toString() + "] with current: " + currentDate + ", other: " + otherDate + " -> " + answer);
+            LOG.debug("Evaluated time clause [{}] with current: {}, other: {} -> {}", new Object[]{toString(), currentDate, otherDate, answer});
         }
 
         return answer;

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java Thu Apr  7 19:45:57 2011
@@ -71,9 +71,7 @@ public class PropertiesComponent extends
             paths = locations.split(",");
         }
         String endpointUri = parseUri(remaining, paths);
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("Endpoint uri parsed as: " + endpointUri);
-        }
+        LOG.debug("Endpoint uri parsed as: {}", endpointUri);
         return getCamelContext().getEndpoint(endpointUri);
     }
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java Thu Apr  7 19:45:57 2011
@@ -97,9 +97,7 @@ public class SedaConsumer extends Servic
         // signal we want to shutdown
         shutdownPending = true;
 
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("Preparing to shutdown, waiting for " + latch.getCount() + " consumer threads to complete.");
-        }
+        LOG.debug("Preparing to shutdown, waiting for {} consumer threads to complete.", latch.getCount());
 
         // wait for all threads to end
         try {
@@ -133,9 +131,7 @@ public class SedaConsumer extends Servic
                     break;
                 }
             } catch (InterruptedException e) {
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("Sleep interrupted, are we stopping? " + (isStopping() || isStopped()));
-                }
+                LOG.debug("Sleep interrupted, are we stopping? {}", isStopping() || isStopped());
                 continue;
             } catch (Throwable e) {
                 if (exchange != null) {
@@ -147,9 +143,7 @@ public class SedaConsumer extends Servic
         }
 
         latch.countDown();
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("Ending this polling consumer thread, there are still " + latch.getCount() + " consumer threads left.");
-        }
+        LOG.debug("Ending this polling consumer thread, there are still {} consumer threads left.", latch.getCount());
     }
 
     /**
@@ -170,7 +164,7 @@ public class SedaConsumer extends Servic
         if (size > 1) {
 
             if (LOG.isDebugEnabled()) {
-                LOG.debug("Multicasting to " + endpoint.getConsumers().size() + " consumers for Exchange: " + exchange);
+                LOG.debug("Multicasting to {} consumers for Exchange: {}", endpoint.getConsumers().size(), exchange);
             }
            
             // use a multicast processor to process it

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/CamelPostProcessorHelper.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/CamelPostProcessorHelper.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/CamelPostProcessorHelper.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/CamelPostProcessorHelper.java Thu Apr  7 19:45:57 2011
@@ -98,9 +98,7 @@ public class CamelPostProcessorHelper im
             try {
                 Processor processor = createConsumerProcessor(bean, method, endpoint);
                 Consumer consumer = endpoint.createConsumer(processor);
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("Created processor: " + processor + " for consumer: " + consumer);
-                }
+                LOG.debug("Created processor: {} for consumer: {}", processor, consumer);
                 startService(consumer, bean, beanName);
             } catch (Exception e) {
                 throw ObjectHelper.wrapRuntimeCamelException(e);
@@ -115,9 +113,7 @@ public class CamelPostProcessorHelper im
         if (isSingleton(bean, beanName)) {
             getCamelContext().addService(service);
         } else {
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("Service is not singleton so you must remember to stop it manually " + service);
-            }
+            LOG.debug("Service is not singleton so you must remember to stop it manually {}", service);
             ServiceHelper.startService(service);
         }
     }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ConsumerCache.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ConsumerCache.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ConsumerCache.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ConsumerCache.java Thu Apr  7 19:45:57 2011
@@ -70,41 +70,31 @@ public class ConsumerCache extends Servi
             }
 
             if (singleton) {
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("Adding to consumer cache with key: " + endpoint + " for consumer: " + answer);
-                }
+                LOG.debug("Adding to consumer cache with key: {} for consumer: {}", endpoint, answer);
                 consumers.put(key, answer);
             } else {
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("Consumer for endpoint: " + key + " is not singleton and thus not added to consumer cache");
-                }
+                LOG.debug("Consumer for endpoint: {} is not singleton and thus not added to consumer cache", key);
             }
         }
         return answer;
     }
 
     public Exchange receive(Endpoint endpoint) {
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("<<<< " + endpoint);
-        }
+        LOG.debug("<<<< {}", endpoint);
 
         PollingConsumer consumer = getConsumer(endpoint);
         return consumer.receive();
     }
 
     public Exchange receive(Endpoint endpoint, long timeout) {
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("<<<< " + endpoint);
-        }
+        LOG.debug("<<<< {}", endpoint);
 
         PollingConsumer consumer = getConsumer(endpoint);
         return consumer.receive(timeout);
     }
 
     public Exchange receiveNoWait(Endpoint endpoint) {
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("<<<< " + endpoint);
-        }
+        LOG.debug("<<<< {}", endpoint);
 
         PollingConsumer consumer = getConsumer(endpoint);
         return consumer.receiveNoWait();

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java Thu Apr  7 19:45:57 2011
@@ -432,7 +432,7 @@ public class DefaultCamelContext extends
                             answer = component.createEndpoint(uri);
 
                             if (answer != null && log.isDebugEnabled()) {
-                                log.debug(uri + " converted to endpoint: " + answer + " by component: " + component);
+                                log.debug("{} converted to endpoint: {} by component: {}", new Object[]{uri, answer, component});
                             }
                         }
                     }
@@ -606,9 +606,7 @@ public class DefaultCamelContext extends
     }
 
     public void addRoutes(RoutesBuilder builder) throws Exception {
-        if (log.isDebugEnabled()) {
-            log.debug("Adding routes from builder: " + builder);
-        }
+        log.debug("Adding routes from builder: {}", builder);
         // lets now add the routes from the builder
         builder.addRoutesToCamelContext(this);
     }
@@ -961,9 +959,7 @@ public class DefaultCamelContext extends
             PropertiesComponent pc = getComponent("properties", PropertiesComponent.class);
             // the parser will throw exception if property key was not found
             String answer = pc.parseUri(text);
-            if (log.isDebugEnabled()) {
-                log.debug("Resolved text: " + text + " -> " + answer);
-            }
+            log.debug("Resolved text: {} -> {}", text, answer);
             return answer;
         }
 
@@ -1831,9 +1827,7 @@ public class DefaultCamelContext extends
             // what this does is to ensure Camel is more robust on starting routes as all routes
             // will then be prepared in time before we start inputs which will consume messages to be routed
             RouteService routeService = entry.getValue().getRouteService();
-            if (log.isDebugEnabled()) {
-                log.debug("Warming up route id: " + routeService.getId() + " having autoStartup=" + autoStartup);
-            }
+            log.debug("Warming up route id: {} having autoStartup={}", routeService.getId(), autoStartup);
             routeService.warmUp();
         }
     }
@@ -1872,13 +1866,11 @@ public class DefaultCamelContext extends
                 }
 
                 // start the consumer on the route
-                if (log.isDebugEnabled()) {
-                    log.debug("Route: " + route.getId() + " >>> " + route);
-                    if (resumeOnly) {
-                        log.debug("Resuming consumer (order: " + order + ") on route: " + route.getId());
-                    } else {
-                        log.debug("Starting consumer (order: " + order + ") on route: " + route.getId());
-                    }
+                log.debug("Route: {} >>> {}", route.getId(), route);
+                if (resumeOnly) {
+                    log.debug("Resuming consumer (order: {}) on route: {}", order, route.getId());
+                } else {
+                    log.debug("Starting consumer (order: {}) on route: {}", order, route.getId());
                 }
 
                 if (resumeOnly && route.supportsSuspension()) {

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponent.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponent.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponent.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponent.java Thu Apr  7 19:45:57 2011
@@ -70,7 +70,7 @@ public abstract class DefaultComponent e
         validateURI(uri, path, parameters);
 
         if (LOG.isDebugEnabled()) {
-            LOG.debug("Creating endpoint uri=[" + uri + "], path=[" + path + "], parameters=[" + parameters + "]");
+            LOG.debug("Creating endpoint uri=[{}], path=[{}], parameters=[{}]", new Object[]{uri, path, parameters});
         }
         Endpoint endpoint = createEndpoint(uri, path, parameters);
         if (endpoint == null) {

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponentResolver.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponentResolver.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponentResolver.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponentResolver.java Thu Apr  7 19:45:57 2011
@@ -47,9 +47,7 @@ public class DefaultComponentResolver im
         Object bean = null;
         try {
             bean = context.getRegistry().lookup(name);
-            if (bean != null && getLog().isDebugEnabled()) {
-                getLog().debug("Found component: " + name + " in registry: " + bean);
-            }
+            getLog().debug("Found component: {} in registry: {}", name, bean);
         } catch (Exception e) {
             getLog().debug("Ignored error looking up bean: " + name, e);
         }
@@ -82,7 +80,7 @@ public class DefaultComponentResolver im
         }
 
         if (getLog().isDebugEnabled()) {
-            getLog().debug("Found component: " + name + " via type: " + type.getName() + " via: " + factoryFinder.getResourcePath() + name);
+            getLog().debug("Found component: {} via type: {} via: {}{}", new Object[]{name, type.getName(), factoryFinder.getResourcePath(), name});
         }
 
         // create the component

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultConsumer.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultConsumer.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultConsumer.java Thu Apr  7 19:45:57 2011
@@ -80,16 +80,12 @@ public class DefaultConsumer extends Ser
     }
 
     protected void doStop() throws Exception {
-        if (log.isDebugEnabled()) {
-            log.debug("Stopping consumer: " + this);
-        }
+        log.debug("Stopping consumer: {}", this);
         ServiceHelper.stopServices(processor);
     }
 
     protected void doStart() throws Exception {
-        if (log.isDebugEnabled()) {
-            log.debug("Starting consumer: " + this);
-        }
+        log.debug("Starting consumer: {}", this);
         ServiceHelper.startServices(processor);
     }
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExecutorServiceStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExecutorServiceStrategy.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExecutorServiceStrategy.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExecutorServiceStrategy.java Thu Apr  7 19:45:57 2011
@@ -143,18 +143,16 @@ public class DefaultExecutorServiceStrat
 
     public ExecutorService lookup(Object source, String name, String executorServiceRef) {
         ExecutorService answer = camelContext.getRegistry().lookup(executorServiceRef, ExecutorService.class);
-        if (answer != null && LOG.isDebugEnabled()) {
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("Looking up ExecutorService with ref: " + executorServiceRef + " and found it from Registry: " + answer);
-            }
+        if (answer != null) {
+            LOG.debug("Looking up ExecutorService with ref: {} and found it from Registry: {}", executorServiceRef, answer);
         }
 
         if (answer == null) {
             // try to see if we got a thread pool profile with that id
             answer = newThreadPool(source, name, executorServiceRef);
-            if (answer != null && LOG.isDebugEnabled()) {
-                LOG.debug("Looking up ExecutorService with ref: " + executorServiceRef
-                        + " and found a matching ThreadPoolProfile to create the ExecutorService: " + answer);
+            if (answer != null) {
+                LOG.debug("Looking up ExecutorService with ref: {} and found a matching ThreadPoolProfile to create the ExecutorService: {}",
+                        executorServiceRef, answer);
             }
         }
 
@@ -163,10 +161,8 @@ public class DefaultExecutorServiceStrat
 
     public ScheduledExecutorService lookupScheduled(Object source, String name, String executorServiceRef) {
         ScheduledExecutorService answer = camelContext.getRegistry().lookup(executorServiceRef, ScheduledExecutorService.class);
-        if (answer != null && LOG.isDebugEnabled()) {
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("Looking up ScheduledExecutorService with ref: " + executorServiceRef + " and found it from Registry: " + answer);
-            }
+        if (answer != null) {
+            LOG.debug("Looking up ScheduledExecutorService with ref: {} and found it from Registry: {}", executorServiceRef, answer);
         }
 
         if (answer == null) {
@@ -174,9 +170,9 @@ public class DefaultExecutorServiceStrat
             if (profile != null) {
                 int poolSize = profile.getPoolSize();
                 answer = newScheduledThreadPool(source, name, poolSize);
-                if (answer != null && LOG.isDebugEnabled()) {
-                    LOG.debug("Looking up ScheduledExecutorService with ref: " + executorServiceRef
-                            + " and found a matching ThreadPoolProfile to create the ScheduledExecutorService: " + answer);
+                if (answer != null) {
+                    LOG.debug("Looking up ScheduledExecutorService with ref: {} and found a matching ThreadPoolProfile to create the ScheduledExecutorService: {}",
+                            executorServiceRef, answer);
                 }
             }
         }
@@ -218,7 +214,7 @@ public class DefaultExecutorServiceStrat
         onThreadPoolCreated(answer, source, null);
 
         if (LOG.isDebugEnabled()) {
-            LOG.debug("Created new cached thread pool for source: " + source + " with name: " + name + ". -> " + answer);
+            LOG.debug("Created new cached thread pool for source: {} with name: {}. -> {}", new Object[]{source, name, answer});
         }
         return answer;
     }
@@ -233,7 +229,7 @@ public class DefaultExecutorServiceStrat
         onThreadPoolCreated(answer, source, null);
 
         if (LOG.isDebugEnabled()) {
-            LOG.debug("Created new scheduled thread pool for source: " + source + " with name: " + name + ". [poolSize=" + poolSize + "]. -> " + answer);
+            LOG.debug("Created new scheduled thread pool for source: {} with name: {}. [poolSize={}]. -> {}", new Object[]{source, name, poolSize, answer});
         }
         return answer;
     }
@@ -243,7 +239,7 @@ public class DefaultExecutorServiceStrat
         onThreadPoolCreated(answer, source, null);
 
         if (LOG.isDebugEnabled()) {
-            LOG.debug("Created new fixed thread pool for source: " + source + " with name: " + name + ". [poolSize=" + poolSize + "]. -> " + answer);
+            LOG.debug("Created new fixed thread pool for source: {} with name: {}. [poolSize={}]. -> {}", new Object[]{source, name, poolSize, answer});
         }
         return answer;
     }
@@ -253,7 +249,7 @@ public class DefaultExecutorServiceStrat
         onThreadPoolCreated(answer, source, null);
 
         if (LOG.isDebugEnabled()) {
-            LOG.debug("Created new single thread pool for source: " + source + " with name: " + name + ". -> " + answer);
+            LOG.debug("Created new single thread pool for source: {} with name: {}. -> {}", new Object[]{source, name, answer});
         }
         return answer;
     }
@@ -263,7 +259,7 @@ public class DefaultExecutorServiceStrat
         onThreadPoolCreated(answer, source, null);
 
         if (LOG.isDebugEnabled()) {
-            LOG.debug("Created new synchronous thread pool for source: " + source + " with name: " + name + ". -> " + answer);
+            LOG.debug("Created new synchronous thread pool for source: {} with name: {}. -> {}", new Object[]{source, name, answer});
         }
         return answer;
     }
@@ -273,8 +269,8 @@ public class DefaultExecutorServiceStrat
         onThreadPoolCreated(answer, source, null);
 
         if (LOG.isDebugEnabled()) {
-            LOG.debug("Created new thread pool for source: " + source + " with name: " + name + ". [poolSize=" + corePoolSize
-                    + ", maxPoolSize=" + maxPoolSize + "] -> " + answer);
+            LOG.debug("Created new thread pool for source: {} with name: {}. [poolSize={}, maxPoolSize={}] -> {}",
+                    new Object[]{source, name, corePoolSize, maxPoolSize, answer});
         }
         return answer;
     }
@@ -284,8 +280,8 @@ public class DefaultExecutorServiceStrat
         onThreadPoolCreated(answer, source, null);
 
         if (LOG.isDebugEnabled()) {
-            LOG.debug("Created new thread pool for source: " + source + " with name: " + name + ". [poolSize=" + corePoolSize
-                    + ", maxPoolSize=" + maxPoolSize + ", maxQueueSize=" + maxQueueSize + "] -> " + answer);
+            LOG.debug("Created new thread pool for source: {} with name: {}. [poolSize={}, maxPoolSize={}, maxQueueSize={}] -> {}",
+                    new Object[]{source, name, corePoolSize, maxPoolSize, maxQueueSize, answer});
         }
         return answer;
     }
@@ -308,10 +304,9 @@ public class DefaultExecutorServiceStrat
         onThreadPoolCreated(answer, source, threadPoolProfileId);
 
         if (LOG.isDebugEnabled()) {
-            LOG.debug("Created new thread pool for source: " + source + " with name: " + name + ". [poolSize=" + corePoolSize
-                    + ", maxPoolSize=" + maxPoolSize + ", keepAliveTime=" + keepAliveTime + " " + timeUnit
-                    + ", maxQueueSize=" + maxQueueSize + ", rejectedExecutionHandler=" + rejectedExecutionHandler
-                    + ", daemon=" + daemon + "] -> " + answer);
+            LOG.debug("Created new thread pool for source: {} with name: {}. [poolSize={}, maxPoolSize={}, keepAliveTime={} {}, maxQueueSize={}, "
+                    + "rejectedExecutionHandler={}, daemon={}] -> {}",
+                    new Object[]{source, name, corePoolSize, maxPoolSize, keepAliveTime, timeUnit, maxQueueSize, rejectedExecutionHandler, daemon, answer});
         }
         return answer;
     }
@@ -330,9 +325,7 @@ public class DefaultExecutorServiceStrat
             return;
         }
 
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("Shutdown ExecutorService: " + executorService);
-        }
+        LOG.debug("Shutdown ExecutorService: {}", executorService);
         executorService.shutdown();
         LOG.trace("Shutdown ExecutorService: {} complete.", executorService);
     }
@@ -344,9 +337,7 @@ public class DefaultExecutorServiceStrat
             return null;
         }
 
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("ShutdownNow ExecutorService: " + executorService);
-        }
+        LOG.debug("ShutdownNow ExecutorService: {}", executorService);
         List<Runnable> answer = executorService.shutdownNow();
         LOG.trace("ShutdownNow ExecutorService: {} complete.", executorService);
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultLanguageResolver.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultLanguageResolver.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultLanguageResolver.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultLanguageResolver.java Thu Apr  7 19:45:57 2011
@@ -46,8 +46,8 @@ public class DefaultLanguageResolver imp
         Object bean = null;
         try {
             bean = context.getRegistry().lookup(name);
-            if (bean != null && getLog().isDebugEnabled()) {
-                getLog().debug("Found language: " + name + " in registry: " + bean);
+            if (bean != null) {
+                getLog().debug("Found language: {} in registry: {}", name, bean);
             }
         } catch (Exception e) {
             if (getLog().isDebugEnabled()) {

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultPackageScanClassResolver.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultPackageScanClassResolver.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultPackageScanClassResolver.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultPackageScanClassResolver.java Thu Apr  7 19:45:57 2011
@@ -120,7 +120,7 @@ public class DefaultPackageScanClassReso
         }
 
         if (log.isDebugEnabled()) {
-            log.debug("Searching for annotations of " + annotation.getName() + " in packages: " + Arrays.asList(packageNames));
+            log.debug("Searching for annotations of {} in packages: {}", annotation.getName(), Arrays.asList(packageNames));
         }
 
         PackageScanFilter test = getCompositeFilter(new AnnotatedWithPackageScanFilter(annotation, true));
@@ -129,9 +129,7 @@ public class DefaultPackageScanClassReso
             find(test, pkg, classes);
         }
 
-        if (log.isDebugEnabled()) {
-            log.debug("Found: " + classes);
-        }
+        log.debug("Found: {}", classes);
 
         return classes;
     }
@@ -143,7 +141,7 @@ public class DefaultPackageScanClassReso
         }
 
         if (log.isDebugEnabled()) {
-            log.debug("Searching for annotations of " + annotations + " in packages: " + Arrays.asList(packageNames));
+            log.debug("Searching for annotations of {} in packages: {}", annotations, Arrays.asList(packageNames));
         }
 
         PackageScanFilter test = getCompositeFilter(new AnnotatedWithAnyPackageScanFilter(annotations, true));
@@ -152,9 +150,7 @@ public class DefaultPackageScanClassReso
             find(test, pkg, classes);
         }
 
-        if (log.isDebugEnabled()) {
-            log.debug("Found: " + classes);
-        }
+        log.debug("Found: {}", classes);
 
         return classes;
     }
@@ -166,7 +162,7 @@ public class DefaultPackageScanClassReso
         }
 
         if (log.isDebugEnabled()) {
-            log.debug("Searching for implementations of " + parent.getName() + " in packages: " + Arrays.asList(packageNames));
+            log.debug("Searching for implementations of {} in packages: {}", parent.getName(), Arrays.asList(packageNames));
         }
 
         PackageScanFilter test = getCompositeFilter(new AssignableToPackageScanFilter(parent));
@@ -175,9 +171,7 @@ public class DefaultPackageScanClassReso
             find(test, pkg, classes);
         }
 
-        if (log.isDebugEnabled()) {
-            log.debug("Found: " + classes);
-        }
+        log.debug("Found: {}", classes);
 
         return classes;
     }
@@ -193,9 +187,7 @@ public class DefaultPackageScanClassReso
             find(filter, pkg, classes);
         }
 
-        if (log.isDebugEnabled()) {
-            log.debug("Found: " + classes);
-        }
+        log.debug("Found: {}", classes);
 
         return classes;
     }
@@ -445,10 +437,7 @@ public class DefaultPackageScanClassReso
                 }
             }
             if (!found) {
-                if (log.isDebugEnabled()) {
-                    // use debug to avoid being noisy in logs
-                    log.debug("Cannot find class '" + fqn + "' in any classloaders: " + set);
-                }
+                log.debug("Cannot find class '{}' in any classloaders: {}", fqn, set);
             }
         } catch (Exception e) {
             if (log.isWarnEnabled()) {

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultProducer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultProducer.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultProducer.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultProducer.java Thu Apr  7 19:45:57 2011
@@ -64,9 +64,7 @@ public abstract class DefaultProducer ex
     protected void doStart() throws Exception {
         // log at debug level for singletons, for prototype scoped log at trace level to not spam logs
         if (isSingleton()) {
-            if (log.isDebugEnabled()) {
-                log.debug("Starting producer: " + this);
-            }
+            log.debug("Starting producer: {}", this);
         } else {
             log.trace("Starting producer: {}", this);
         }
@@ -75,9 +73,7 @@ public abstract class DefaultProducer ex
     protected void doStop() throws Exception {
         // log at debug level for singletons, for prototype scoped log at trace level to not spam logs
         if (isSingleton()) {
-            if (log.isDebugEnabled()) {
-                log.debug("Stopping producer: " + this);
-            }
+            log.debug("Stopping producer: {}", this);
         } else {
             log.trace("Stopping producer: {}", this);
         }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultServicePool.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultServicePool.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultServicePool.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultServicePool.java Thu Apr  7 19:45:57 2011
@@ -100,15 +100,11 @@ public abstract class DefaultServicePool
     }
 
     protected void doStart() throws Exception {
-        if (log.isDebugEnabled()) {
-            log.debug("Starting service pool: " + this);
-        }
+        log.debug("Starting service pool: {}", this);
     }
 
     protected void doStop() throws Exception {
-        if (log.isDebugEnabled()) {
-            log.debug("Stopping service pool: " + this);
-        }
+        log.debug("Stopping service pool: {}", this);
         for (BlockingQueue<Service> entry : pool.values()) {
             Collection<Service> values = new ArrayList<Service>();
             entry.drainTo(values);

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java Thu Apr  7 19:45:57 2011
@@ -250,9 +250,7 @@ public class DefaultShutdownStrategy ext
             EventHelper.notifyServiceStopFailure(consumer.getEndpoint().getCamelContext(), consumer, e);
         }
 
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("Shutdown complete for: " + consumer);
-        }
+        LOG.debug("Shutdown complete for: {}", consumer);
     }
 
     /**
@@ -272,9 +270,7 @@ public class DefaultShutdownStrategy ext
             EventHelper.notifyServiceStopFailure(consumer.getEndpoint().getCamelContext(), consumer, e);
         }
 
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("Suspend complete for: " + consumer);
-        }
+        LOG.debug("Suspend complete for: {}", consumer);
     }
 
     private ExecutorService getExecutorService() {
@@ -346,9 +342,7 @@ public class DefaultShutdownStrategy ext
             // 2) wait until all inflight and pending exchanges has been completed
             // 3) shutdown the deferred routes
 
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("There are " + routes.size() + " routes to " + (suspendOnly ? "suspend" : "shutdown"));
-            }
+            LOG.debug("There are {} routes to {}", routes.size(), suspendOnly ? "suspend" : "shutdown");
 
             // list of deferred consumers to shutdown when all exchanges has been completed routed
             // and thus there are no more inflight exchanges so they can be safely shutdown at that time
@@ -423,9 +417,7 @@ public class DefaultShutdownStrategy ext
                         }
                         if (inflight > 0) {
                             size += inflight;
-                            if (LOG.isDebugEnabled()) {
-                                LOG.debug(inflight + " inflight and pending exchanges for consumer: " + consumer);
-                            }
+                            LOG.debug("{} inflight and pending exchanges for consumer: {}", inflight, consumer);
                         }
                     }
                 }
@@ -455,7 +447,7 @@ public class DefaultShutdownStrategy ext
                 Consumer consumer = deferred.getConsumer();
                 if (consumer instanceof ShutdownAware) {
                     if (LOG.isDebugEnabled()) {
-                        LOG.debug("Route: " + deferred.getRoute().getId() + " preparing to shutdown.");
+                        LOG.debug("Route: {} preparing to shutdown.", deferred.getRoute().getId());
                     }
                     ((ShutdownAware) consumer).prepareShutdown();
                     LOG.info("Route: " + deferred.getRoute().getId() + " preparing to shutdown complete.");

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/InterceptSendToEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/InterceptSendToEndpoint.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/InterceptSendToEndpoint.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/InterceptSendToEndpoint.java Thu Apr  7 19:45:57 2011
@@ -112,7 +112,7 @@ public class InterceptSendToEndpoint imp
             public void process(Exchange exchange) throws Exception {
                 // process the detour so we do the detour routing
                 if (LOG.isDebugEnabled()) {
-                    LOG.debug("Sending to endpoint: " + getEndpointUri() + " is intercepted and detoured to: " + detour + " for exchange: " + exchange);
+                    LOG.debug("Sending to endpoint: {} is intercepted and detoured to: {} for exchange: {}", new Object[]{getEndpointUri(), detour, exchange});
                 }
                 // add header with the real endpoint uri
                 exchange.getIn().setHeader(Exchange.INTERCEPTED_ENDPOINT, delegate.getEndpointUri());
@@ -139,9 +139,7 @@ public class InterceptSendToEndpoint imp
                     // route to original destination
                     producer.process(exchange);
                 } else {
-                    if (LOG.isDebugEnabled()) {
-                        LOG.debug("Stop() means skip sending exchange to original intended destination: " + getEndpointUri() + " for exchange: " + exchange);
-                    }
+                    LOG.debug("Stop() means skip sending exchange to original intended destination: {} for exchange: {}", getEndpointUri(), exchange);
                 }
             }
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/LimitedPollingConsumerPollStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/LimitedPollingConsumerPollStrategy.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/LimitedPollingConsumerPollStrategy.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/LimitedPollingConsumerPollStrategy.java Thu Apr  7 19:45:57 2011
@@ -68,9 +68,7 @@ public class LimitedPollingConsumerPollS
         } else {
             times += 1;
         }
-        if (log.isDebugEnabled()) {
-            log.debug("Rollback occurred after " + times + " times when consuming " + endpoint);
-        }
+        log.debug("Rollback occurred after {} times when consuming {}", times, endpoint);
 
         boolean retry = false;
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ProducerCache.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ProducerCache.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ProducerCache.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ProducerCache.java Thu Apr  7 19:45:57 2011
@@ -318,9 +318,7 @@ public class ProducerCache extends Servi
                 }
 
                 // now lets dispatch
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug(">>>> " + endpoint + " " + exchange);
-                }
+                LOG.debug(">>>> {} {}", endpoint, exchange);
 
                 // set property which endpoint we send to
                 exchange.setProperty(Exchange.TO_ENDPOINT, endpoint.getEndpointUri());
@@ -364,14 +362,10 @@ public class ProducerCache extends Servi
 
             // add producer to cache or pool if applicable
             if (pooled && answer instanceof ServicePoolAware) {
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("Adding to producer service pool with key: " + endpoint + " for producer: " + answer);
-                }
+                LOG.debug("Adding to producer service pool with key: {} for producer: {}", endpoint, answer);
                 answer = pool.addAndAcquire(endpoint, answer);
             } else if (answer.isSingleton()) {
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("Adding to producer cache with key: " + endpoint + " for producer: " + answer);
-                }
+                LOG.debug("Adding to producer cache with key: {} for producer: {}", endpoint, answer);
                 producers.put(key, answer);
             }
         }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/RoutePolicySupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/RoutePolicySupport.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/RoutePolicySupport.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/RoutePolicySupport.java Thu Apr  7 19:45:57 2011
@@ -51,16 +51,16 @@ public abstract class RoutePolicySupport
 
     protected boolean startConsumer(Consumer consumer) throws Exception {
         boolean resumed = ServiceHelper.resumeService(consumer);
-        if (resumed && log.isDebugEnabled()) {
-            log.debug("Resuming consumer " + consumer);
+        if (resumed) {
+            log.debug("Resuming consumer {}", consumer);
         }
         return resumed;
     }
 
     protected boolean stopConsumer(Consumer consumer) throws Exception {
         boolean suspended = ServiceHelper.suspendService(consumer);
-        if (suspended && log.isDebugEnabled()) {
-            log.debug("Suspended consumer " + consumer);
+        if (suspended) {
+            log.debug("Suspended consumer {}", consumer);
         }
         return suspended;
     }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/RouteService.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/RouteService.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/RouteService.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/RouteService.java Thu Apr  7 19:45:57 2011
@@ -118,9 +118,7 @@ public class RouteService extends Servic
         if (warmUpDone.compareAndSet(false, true)) {
 
             for (Route route : routes) {
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("Starting services on route: " + route.getId());
-                }
+                LOG.debug("Starting services on route: {}", route.getId());
 
                 List<Service> services = route.getServices();
 
@@ -182,9 +180,7 @@ public class RouteService extends Servic
         }
         
         for (Route route : routes) {
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("Stopping services on route: " + route.getId());
-            }
+            LOG.debug("Stopping services on route: {}", route.getId());
             // getServices will not add services again
             List<Service> services = route.getServices();
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollConsumer.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollConsumer.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollConsumer.java Thu Apr  7 19:45:57 2011
@@ -82,9 +82,7 @@ public abstract class ScheduledPollConsu
                     if (retryCounter == -1) {
                         LOG.trace("Starting to poll: {}", this.getEndpoint());
                     } else {
-                        if (LOG.isDebugEnabled()) {
-                            LOG.debug("Retrying attempt " + retryCounter + " to poll: " + this.getEndpoint());
-                        }
+                        LOG.debug("Retrying attempt {} to poll: {}", retryCounter, this.getEndpoint());
                     }
 
                     boolean begin = pollStrategy.begin(this, getEndpoint());
@@ -93,9 +91,7 @@ public abstract class ScheduledPollConsu
                         int polledMessages = poll();
                         pollStrategy.commit(this, getEndpoint(), polledMessages);
                     } else {
-                        if (LOG.isDebugEnabled()) {
-                            LOG.debug("Cannot begin polling as pollStrategy returned false: " + pollStrategy);
-                        }
+                        LOG.debug("Cannot begin polling as pollStrategy returned false: {}", pollStrategy);
                     }
                 }
 
@@ -188,14 +184,14 @@ public abstract class ScheduledPollConsu
         super.doStart();
         if (isUseFixedDelay()) {
             if (LOG.isDebugEnabled()) {
-                LOG.debug("Scheduling poll (fixed delay) with initialDelay: " + getInitialDelay() + ", delay: " + getDelay()
-                        + " (" + getTimeUnit().name().toLowerCase() + ") for: " + getEndpoint());
+                LOG.debug("Scheduling poll (fixed delay) with initialDelay: {}, delay: {} ({}) for: {}",
+                        new Object[]{getInitialDelay(), getDelay(), getTimeUnit().name().toLowerCase(), getEndpoint()});
             }
             future = executor.scheduleWithFixedDelay(this, getInitialDelay(), getDelay(), getTimeUnit());
         } else {
             if (LOG.isDebugEnabled()) {
-                LOG.debug("Scheduling poll (fixed rate) with initialDelay: " + getInitialDelay() + ", delay: " + getDelay()
-                        + " (" + getTimeUnit().name().toLowerCase() + ") for: " + getEndpoint());
+                LOG.debug("Scheduling poll (fixed rate) with initialDelay: {}, delay: {} ({}) for: {}",
+                        new Object[]{getInitialDelay(), getDelay(), getTimeUnit().name().toLowerCase(), getEndpoint()});
             }
             future = executor.scheduleAtFixedRate(this, getInitialDelay(), getDelay(), getTimeUnit());
         }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/AnnotationTypeConverterLoader.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/AnnotationTypeConverterLoader.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/AnnotationTypeConverterLoader.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/AnnotationTypeConverterLoader.java Thu Apr  7 19:45:57 2011
@@ -119,9 +119,7 @@ public class AnnotationTypeConverterLoad
             if (!visitedURIs.contains(uri)) {
                 // remember we have visited this uri so we wont read it twice
                 visitedURIs.add(uri);
-                if (LOG.isDebugEnabled()) {
-                    LOG.info("Loading file " + META_INF_SERVICES + " to retrieve list of packages, from url: " + url);
-                }
+                LOG.info("Loading file {} to retrieve list of packages, from url: {}", META_INF_SERVICES, url);
                 BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
                 try {
                     while (true) {

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java Thu Apr  7 19:45:57 2011
@@ -109,8 +109,7 @@ public abstract class BaseTypeConverterR
 
             // we cannot convert so return null
             if (log.isDebugEnabled()) {
-                log.debug(NoTypeConversionAvailableException.createMessage(value, type)
-                        + " Caused by: " + e.getMessage() + ". Will ignore this and continue.");
+                log.debug("{} Caused by: {}. Will ignore this and continue.", NoTypeConversionAvailableException.createMessage(value, type), e.getMessage());
             }
             return null;
         }
@@ -198,9 +197,8 @@ public abstract class BaseTypeConverterR
                 if (fallback.isCanPromote()) {
                     // add it as a known type converter since we found a fallback that could do it
                     if (log.isDebugEnabled()) {
-                        log.debug("Promoting fallback type converter as a known type converter to convert from: "
-                                + type.getCanonicalName() + " to: " + value.getClass().getCanonicalName()
-                                + " for the fallback converter: " + fallback.getFallbackTypeConverter());
+                        log.debug("Promoting fallback type converter as a known type converter to convert from: {} to: {} for the fallback converter: {}",
+                                new Object[]{type.getCanonicalName(), value.getClass().getCanonicalName(), fallback.getFallbackTypeConverter()});
                     }
                     addTypeConverter(type, value.getClass(), fallback.getFallbackTypeConverter());
                 }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java Thu Apr  7 19:45:57 2011
@@ -94,9 +94,7 @@ public class Activator implements Bundle
     }
 
     public Object addingBundle(Bundle bundle, BundleEvent event) {
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("Bundle started: " + bundle.getSymbolicName());
-        }
+        LOG.debug("Bundle started: {}", bundle.getSymbolicName());
         List<BaseService> r = new ArrayList<BaseService>();
         registerComponents(bundle, r);
         registerLanguages(bundle, r);
@@ -113,9 +111,7 @@ public class Activator implements Bundle
     }
 
     public void removedBundle(Bundle bundle, BundleEvent event, Object object) {
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("Bundle stopped: " + bundle.getSymbolicName());
-        }
+        LOG.debug("Bundle stopped: {}", bundle.getSymbolicName());
         List<BaseService> r = resolvers.remove(bundle.getBundleId());
         if (r != null) {
             for (BaseService service : r) {
@@ -129,9 +125,7 @@ public class Activator implements Bundle
             Map<String, String> components = new HashMap<String, String>();
             for (Enumeration e = bundle.getEntryPaths(META_INF_COMPONENT); e != null && e.hasMoreElements();) {
                 String path = (String) e.nextElement();
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("Found entry: " + path + " in bundle " + bundle.getSymbolicName());
-                }
+                LOG.debug("Found entry: {} in bundle {}", path, bundle.getSymbolicName());
                 String name = path.substring(path.lastIndexOf("/") + 1);
                 components.put(name, path);
             }
@@ -146,9 +140,7 @@ public class Activator implements Bundle
             Map<String, String> languages = new HashMap<String, String>();
             for (Enumeration e = bundle.getEntryPaths(META_INF_LANGUAGE); e != null && e.hasMoreElements();) {
                 String path = (String) e.nextElement();
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("Found entry: " + path + " in bundle " + bundle.getSymbolicName());
-                }
+                LOG.debug("Found entry: {} in bundle {}", path, bundle.getSymbolicName());
                 String name = path.substring(path.lastIndexOf("/") + 1);
                 languages.put(name, path);
             }
@@ -157,9 +149,7 @@ public class Activator implements Bundle
             }
             for (Enumeration e = bundle.getEntryPaths(META_INF_LANGUAGE_RESOLVER); e != null && e.hasMoreElements();) {
                 String path = (String) e.nextElement();
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("Found entry: " + path + " in bundle " + bundle.getSymbolicName());
-                }
+                LOG.debug("Found entry: {} in bundle {}", path, bundle.getSymbolicName());
                 String name = path.substring(path.lastIndexOf("/") + 1);
                 resolvers.add(new BundleMetaLanguageResolver(bundle, name, path));
             }
@@ -171,9 +161,7 @@ public class Activator implements Bundle
             Map<String, String> dataformats = new HashMap<String, String>();
             for (Enumeration e = bundle.getEntryPaths(META_INF_DATAFORMAT); e != null && e.hasMoreElements();) {
                 String path = (String) e.nextElement();
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("Found entry: " + path + " in bundle " + bundle.getSymbolicName());
-                }
+                LOG.debug("Found entry: {} in bundle {}", path, bundle.getSymbolicName());
                 String name = path.substring(path.lastIndexOf("/") + 1);
                 dataformats.put(name, path);
             }
@@ -323,10 +311,10 @@ public class Activator implements Bundle
                         }
                     }
                 }
-                LOG.info("Found " + classes.size() + " @Converter classes to load");
+                LOG.info("Found {} @Converter classes to load", classes.size());
                 for (Class type : classes) {
                     if (LOG.isDebugEnabled()) {
-                        LOG.debug("Loading converter class: " + ObjectHelper.name(type));
+                        LOG.debug("Loading converter class: {}", ObjectHelper.name(type));
                     }
                     loadConverterMethods(registry, type);
                 }
@@ -357,9 +345,7 @@ public class Activator implements Bundle
                 return null;
             }
             URL url = bundle.getEntry(path);
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("The entry " + name + "'s url is" + url);
-            }
+            LOG.debug("The entry {}'s url is {}", name, url);
             return createInstance(name, url, context.getInjector());
         }
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/language/simple/SimpleLanguageSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/language/simple/SimpleLanguageSupport.java?rev=1089960&r1=1089959&r2=1089960&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/language/simple/SimpleLanguageSupport.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/language/simple/SimpleLanguageSupport.java Thu Apr  7 19:45:57 2011
@@ -81,19 +81,13 @@ public abstract class SimpleLanguageSupp
         Matcher matcher = OPERATOR_PATTERN.matcher(expression);
         Matcher startMatcher = START_ANDOR_PATTERN.matcher(expression);
         if (matcher.matches() || startMatcher.matches()) {
-            if (log.isDebugEnabled()) {
-                log.debug("Expression is evaluated as simple (with operator) expression: " + expression);
-            }
+            log.debug("Expression is evaluated as simple (with operator) expression: {}", expression);
             return createOperatorExpression(matcher, startMatcher, expression);
         } else if (SimpleLanguage.hasStartToken(expression)) {
-            if (log.isDebugEnabled()) {
-                log.debug("Expression is evaluated as simple (strict) expression: " + expression);
-            }
+            log.debug("Expression is evaluated as simple (strict) expression: {}", expression);
             return createComplexConcatExpression(expression);
         } else {
-            if (log.isDebugEnabled()) {
-                log.debug("Expression is evaluated as simple (non strict) expression: " + expression);
-            }
+            log.debug("Expression is evaluated as simple (non strict) expression: {}", expression);
             return createSimpleExpression(expression, false);
         }
     }



Mime
View raw message