camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1165295 - in /camel/trunk/camel-core/src/main/java/org/apache/camel: impl/DefaultExchangeFormatter.java processor/CamelLogProcessor.java processor/CamelLogger.java
Date Mon, 05 Sep 2011 14:17:12 GMT
Author: cschneider
Date: Mon Sep  5 14:17:12 2011
New Revision: 1165295

URL: http://svn.apache.org/viewvc?rev=1165295&view=rev
Log:
CAMEL-4414 Move DefaultExchangeFormatter to an inner class as it is only used internally.
Also removing getInstance as the class is so simple a new will not hurt

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchangeFormatter.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/CamelLogProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/CamelLogger.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/CamelLogProcessor.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/CamelLogProcessor.java?rev=1165295&r1=1165294&r2=1165295&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/CamelLogProcessor.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/CamelLogProcessor.java
Mon Sep  5 14:17:12 2011
@@ -19,7 +19,6 @@ package org.apache.camel.processor;
 import org.apache.camel.Exchange;
 import org.apache.camel.LoggingLevel;
 import org.apache.camel.Processor;
-import org.apache.camel.impl.DefaultExchangeFormatter;
 import org.apache.camel.spi.ExchangeFormatter;
 import org.apache.camel.util.CamelLogger;
 
@@ -34,13 +33,14 @@ import org.apache.camel.util.CamelLogger
  */
 public class CamelLogProcessor implements Processor {
     private CamelLogger log;
-    private ExchangeFormatter formatter = DefaultExchangeFormatter.getInstance();
+    private ExchangeFormatter formatter;
 
     public CamelLogProcessor() {
         this(new CamelLogger(CamelLogProcessor.class.getName()));
     }
     
     public CamelLogProcessor(CamelLogger log) {
+        this.formatter = new DefaultExchangeFormatter();
         this.log = log;
     }
 
@@ -84,5 +84,9 @@ public class CamelLogProcessor implement
         log.setLevel(level);
     }
 
-
+    static class DefaultExchangeFormatter implements ExchangeFormatter {
+        public String format(Exchange exchange) {
+            return exchange.toString();
+        }
+    }
 }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/CamelLogger.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/CamelLogger.java?rev=1165295&r1=1165294&r2=1165295&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/CamelLogger.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/CamelLogger.java Mon Sep
 5 14:17:12 2011
@@ -19,7 +19,6 @@ package org.apache.camel.processor;
 import org.apache.camel.Exchange;
 import org.apache.camel.LoggingLevel;
 import org.apache.camel.Processor;
-import org.apache.camel.impl.DefaultExchangeFormatter;
 import org.apache.camel.spi.ExchangeFormatter;
 import org.apache.camel.support.ServiceSupport;
 import org.slf4j.Logger;
@@ -38,7 +37,7 @@ import org.slf4j.LoggerFactory;
 public class CamelLogger extends ServiceSupport implements Processor {
     private Logger log;
     private LoggingLevel level;
-    private ExchangeFormatter formatter = DefaultExchangeFormatter.getInstance();
+    private ExchangeFormatter formatter;
 
     public CamelLogger() {
         this(LoggerFactory.getLogger(CamelLogger.class));
@@ -49,6 +48,7 @@ public class CamelLogger extends Service
     }
 
     public CamelLogger(Logger log, LoggingLevel level) {
+        this.formatter = new CamelLogProcessor.DefaultExchangeFormatter();
         this.log = log;
         this.level = level;
     }



Mime
View raw message