camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r927094 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/component/log/LogFormatter.java test/java/org/apache/camel/component/log/LogFormatterTest.java
Date Wed, 24 Mar 2010 15:57:07 GMT
Author: davsclaus
Date: Wed Mar 24 15:57:07 2010
New Revision: 927094

URL: http://svn.apache.org/viewvc?rev=927094&view=rev
Log:
CAMEL-2574: Log component now supports logging the MEP.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/log/LogFormatter.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/component/log/LogFormatterTest.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/log/LogFormatter.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/log/LogFormatter.java?rev=927094&r1=927093&r2=927094&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/log/LogFormatter.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/log/LogFormatter.java
Wed Mar 24 15:57:07 2010
@@ -32,6 +32,7 @@ import org.apache.camel.util.ObjectHelpe
 public class LogFormatter implements ExchangeFormatter {
 
     private boolean showExchangeId;
+    private boolean showExchangePattern = true;
     private boolean showProperties;
     private boolean showHeaders;
     private boolean showBodyType = true;
@@ -55,6 +56,13 @@ public class LogFormatter implements Exc
             }
             sb.append(", Id:").append(exchange.getExchangeId());
         }
+        if (showAll || showExchangePattern) {
+            if (multiline) {
+                sb.append('\n');
+            }
+            sb.append(", ExchangePattern:").append(exchange.getPattern());
+        }
+
         if (showAll || showProperties) {
             if (multiline) {
                 sb.append('\n');
@@ -275,6 +283,13 @@ public class LogFormatter implements Exc
         this.showFuture = showFuture;
     }
 
+    public boolean isShowExchangePattern() {
+        return showExchangePattern;
+    }
+
+    public void setShowExchangePattern(boolean showExchangePattern) {
+        this.showExchangePattern = showExchangePattern;
+    }
 
     // Implementation methods
     //-------------------------------------------------------------------------

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/component/log/LogFormatterTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/log/LogFormatterTest.java?rev=927094&r1=927093&r2=927094&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/component/log/LogFormatterTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/log/LogFormatterTest.java
Wed Mar 24 15:57:07 2010
@@ -37,6 +37,8 @@ public class LogFormatterTest extends Co
     @SuppressWarnings("unchecked")
     public void testSendMessageToLogSingleOptions() throws Exception {
         template.sendBody("log:org.apache.camel.TEST?showExchangeId=true", "Hello World");
+        template.sendBody("log:org.apache.camel.TEST?showExchangePattern=true", "Hello World");
+        template.sendBody("log:org.apache.camel.TEST?showExchangePattern=false", "Hello World");
         template.sendBody("log:org.apache.camel.TEST?showProperties=true", "Hello World");
         template.sendBody("log:org.apache.camel.TEST?showHeaders=true", "Hello World");
         template.sendBody("log:org.apache.camel.TEST?showBodyType=true", "Hello World");



Mime
View raw message