camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [3/3] git commit: CAMEL-6637: Beanio should log invalid at DEBUG level if configured to ignore. Thanks to Sam Lewis for the patch.
Date Wed, 14 Aug 2013 13:08:59 GMT
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 <davsclaus@apache.org>
Authored: Wed Aug 14 14:55:55 2013 +0200
Committer: Claus Ibsen <davsclaus@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;
                 }
             }


Mime
View raw message