You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by gg...@apache.org on 2017/06/27 06:11:07 UTC

[2/3] camel git commit: [CAMEL-11427] Improve logging when choosing leveldb DBFactory

[CAMEL-11427] Improve logging when choosing leveldb DBFactory

(cherry picked from commit 2feec9d29308272dfe9f6c31331763f51ac0b892)


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

Branch: refs/heads/camel-2.19.x
Commit: fc3647c210bceb9ca51e750cc7ccee06136b9c94
Parents: e525258
Author: Grzegorz Grzybek <gr...@gmail.com>
Authored: Tue Jun 27 08:08:53 2017 +0200
Committer: Grzegorz Grzybek <gr...@gmail.com>
Committed: Tue Jun 27 08:10:23 2017 +0200

----------------------------------------------------------------------
 .../org/apache/camel/component/leveldb/LevelDBFile.java     | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/fc3647c2/components/camel-leveldb/src/main/java/org/apache/camel/component/leveldb/LevelDBFile.java
----------------------------------------------------------------------
diff --git a/components/camel-leveldb/src/main/java/org/apache/camel/component/leveldb/LevelDBFile.java b/components/camel-leveldb/src/main/java/org/apache/camel/component/leveldb/LevelDBFile.java
index 6a86a73..9e0a6d9 100644
--- a/components/camel-leveldb/src/main/java/org/apache/camel/component/leveldb/LevelDBFile.java
+++ b/components/camel-leveldb/src/main/java/org/apache/camel/component/leveldb/LevelDBFile.java
@@ -186,9 +186,12 @@ public class LevelDBFile implements Service {
         for (String cn : classNames) {
             try {
                 Class<?> clz = getClass().getClassLoader().loadClass(cn);
-                return (DBFactory) clz.newInstance();
-            } catch (Exception e) {
-                LOG.warn(e.getMessage(), e);
+                DBFactory factory = (DBFactory) clz.newInstance();
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("Using {} implementation of org.iq80.leveldb.DBFactory", factory.getClass().getName());
+                }
+                return factory;
+            } catch (Exception ignored) {
             }
         }
         throw new IllegalStateException("Can't find implementation of org.iq80.leveldb.DBFactory");