camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r897659 - /camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DefaultChannel.java
Date Sun, 10 Jan 2010 16:56:17 GMT
Author: davsclaus
Date: Sun Jan 10 16:56:17 2010
New Revision: 897659

URL: http://svn.apache.org/viewvc?rev=897659&view=rev
Log:
Fixed default tracer not picking up custom traceFormatter.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DefaultChannel.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DefaultChannel.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DefaultChannel.java?rev=897659&r1=897658&r2=897659&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DefaultChannel.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DefaultChannel.java Sun
Jan 10 16:56:17 2010
@@ -27,6 +27,7 @@
 import org.apache.camel.Service;
 import org.apache.camel.impl.ServiceSupport;
 import org.apache.camel.model.ProcessorDefinition;
+import org.apache.camel.processor.interceptor.TraceFormatter;
 import org.apache.camel.processor.interceptor.TraceInterceptor;
 import org.apache.camel.processor.interceptor.Tracer;
 import org.apache.camel.spi.InterceptStrategy;
@@ -193,6 +194,15 @@
             if (tracer == null) {
                 // fallback to use the default tracer
                 tracer = camelContext.getDefaultTracer();
+
+                // configure and use any trace formatter if any exists
+                Map<String, TraceFormatter> formatters = camelContext.getRegistry().lookupByType(TraceFormatter.class);
+                if (formatters.size() == 1) {
+                    TraceFormatter formatter = formatters.values().iterator().next();
+                    if (tracer instanceof Tracer) {
+                        ((Tracer) tracer).setFormatter(formatter);
+                    }
+                }
             }
         }
 



Mime
View raw message