You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2013/08/14 15:08:59 UTC

[3/3] git commit: CAMEL-6637: Beanio should log invalid at DEBUG level if configured to ignore. Thanks to Sam Lewis for the patch.

CAMEL-6637: Beanio should log invalid at DEBUG level if configured to ignore. Thanks to Sam Lewis for the patch.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e3db2228
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e3db2228
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e3db2228

Branch: refs/heads/camel-2.11.x
Commit: e3db2228af66d6b2b5559ff4ade9002d31271d1e
Parents: 21ea2d6
Author: Claus Ibsen <da...@apache.org>
Authored: Wed Aug 14 14:55:55 2013 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Aug 14 15:08:40 2013 +0200

----------------------------------------------------------------------
 .../dataformat/beanio/BeanIODataFormat.java     | 24 ++++++++++++--------
 1 file changed, 15 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/e3db2228/components/camel-beanio/src/main/java/org/apache/camel/dataformat/beanio/BeanIODataFormat.java
----------------------------------------------------------------------
diff --git a/components/camel-beanio/src/main/java/org/apache/camel/dataformat/beanio/BeanIODataFormat.java b/components/camel-beanio/src/main/java/org/apache/camel/dataformat/beanio/BeanIODataFormat.java
index 75e5ffb..63b8632 100644
--- a/components/camel-beanio/src/main/java/org/apache/camel/dataformat/beanio/BeanIODataFormat.java
+++ b/components/camel-beanio/src/main/java/org/apache/camel/dataformat/beanio/BeanIODataFormat.java
@@ -163,27 +163,33 @@ public class BeanIODataFormat extends ServiceSupport implements DataFormat, Came
 
             @Override
             public void invalidRecord(InvalidRecordException ex) throws Exception {
-                LOG.warn(LOG_PREFIX + ex.getMessage() + ": " + ex.getRecordContext().getRecordText());
-
-                if (!ignoreInvalidRecords) {
+                String msg = LOG_PREFIX + "InvalidRecord: " + ex.getMessage() + ": " + ex.getRecordContext().getRecordText();
+                if (ignoreInvalidRecords) {
+                    LOG.debug(msg);
+                } else {
+                    LOG.warn(msg);
                     throw ex;
                 }
             }
 
             @Override
             public void unexpectedRecord(UnexpectedRecordException ex) throws Exception {
-                LOG.warn(LOG_PREFIX + ex.getMessage() + ": " + ex.getRecordContext().getRecordText());
-
-                if (!ignoreUnexpectedRecords) {
+                String msg = LOG_PREFIX + "UnexpectedRecord: " + ex.getMessage() + ": " + ex.getRecordContext().getRecordText();
+                if (ignoreUnexpectedRecords) {
+                    LOG.debug(msg);
+                } else {
+                    LOG.warn(msg);
                     throw ex;
                 }
             }
 
             @Override
             public void unidentifiedRecord(UnidentifiedRecordException ex) throws Exception {
-                LOG.warn(LOG_PREFIX + ex.getMessage() + ": " + ex.getRecordContext().getRecordText());
-
-                if (!ignoreUnidentifiedRecords) {
+                String msg = LOG_PREFIX + "UnidentifiedRecord: " + ex.getMessage() + ": " + ex.getRecordContext().getRecordText();
+                if (ignoreUnidentifiedRecords) {
+                    LOG.debug(msg);
+                } else {
+                    LOG.warn(msg);
                     throw ex;
                 }
             }