camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [3/8] camel git commit: Added a bit of logging
Date Wed, 05 Jul 2017 09:27:01 GMT
Added a bit of logging


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

Branch: refs/heads/master
Commit: 509eab166bc27023e4504f6e93321dee0f993166
Parents: 1abeae7
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Wed Jul 5 10:59:03 2017 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Wed Jul 5 10:59:03 2017 +0200

----------------------------------------------------------------------
 .../twitter/consumer/AbstractTwitterConsumerHandler.java         | 4 ++++
 .../twitter/timeline/AbstractStatusConsumerHandler.java          | 2 +-
 .../camel/component/twitter/timeline/HomeConsumerHandler.java    | 2 ++
 .../component/twitter/timeline/MentionsConsumerHandler.java      | 2 ++
 .../component/twitter/timeline/RetweetsConsumerHandler.java      | 2 ++
 .../camel/component/twitter/timeline/UserConsumerHandler.java    | 2 ++
 6 files changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/509eab16/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/AbstractTwitterConsumerHandler.java
----------------------------------------------------------------------
diff --git a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/AbstractTwitterConsumerHandler.java
b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/AbstractTwitterConsumerHandler.java
index b0ec1f0..1fa515b 100644
--- a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/AbstractTwitterConsumerHandler.java
+++ b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/AbstractTwitterConsumerHandler.java
@@ -20,6 +20,8 @@ import java.util.List;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.component.twitter.TwitterEndpoint;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import twitter4j.Paging;
 import twitter4j.Twitter;
 import twitter4j.TwitterException;
@@ -27,6 +29,8 @@ import twitter4j.TwitterException;
 
 public abstract class AbstractTwitterConsumerHandler {
 
+    protected final Logger log = LoggerFactory.getLogger(this.getClass());
+
     /**
      * Instance of TwitterEndpoint.
      */

http://git-wip-us.apache.org/repos/asf/camel/blob/509eab16/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/timeline/AbstractStatusConsumerHandler.java
----------------------------------------------------------------------
diff --git a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/timeline/AbstractStatusConsumerHandler.java
b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/timeline/AbstractStatusConsumerHandler.java
index ec7d801..9de0d40 100644
--- a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/timeline/AbstractStatusConsumerHandler.java
+++ b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/timeline/AbstractStatusConsumerHandler.java
@@ -36,7 +36,7 @@ abstract class AbstractStatusConsumerHandler extends AbstractTwitterConsumerHand
 
     @Override
     public List<Exchange> pollConsume() throws TwitterException {
-        List<Status> statusList =  doPoll();
+        List<Status> statusList = doPoll();
         for (int i = 0; i < statusList.size(); i++) {
             setLastIdIfGreater(statusList.get(i).getId());
         }

http://git-wip-us.apache.org/repos/asf/camel/blob/509eab16/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/timeline/HomeConsumerHandler.java
----------------------------------------------------------------------
diff --git a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/timeline/HomeConsumerHandler.java
b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/timeline/HomeConsumerHandler.java
index 585ab03..2411e0a 100644
--- a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/timeline/HomeConsumerHandler.java
+++ b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/timeline/HomeConsumerHandler.java
@@ -33,11 +33,13 @@ public class HomeConsumerHandler extends AbstractStatusConsumerHandler
{
 
     @Override
     protected List<Status> doPoll() throws TwitterException {
+        log.trace("doPoll.getHomeTimeline(sinceId={})", getLastIdPaging().getSinceId());
         return getTwitter().getHomeTimeline(getLastIdPaging());
     }
 
     @Override
     protected List<Status> doDirect() throws TwitterException {
+        log.trace("doDirect.getHomeTimeline()");
         return getTwitter().getHomeTimeline();
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/509eab16/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/timeline/MentionsConsumerHandler.java
----------------------------------------------------------------------
diff --git a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/timeline/MentionsConsumerHandler.java
b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/timeline/MentionsConsumerHandler.java
index 95a2576..9601c99 100644
--- a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/timeline/MentionsConsumerHandler.java
+++ b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/timeline/MentionsConsumerHandler.java
@@ -33,11 +33,13 @@ public class MentionsConsumerHandler extends AbstractStatusConsumerHandler
{
 
     @Override
     protected List<Status> doPoll() throws TwitterException {
+        log.trace("doPoll.getMentionsTimeline(sinceId={})", getLastIdPaging().getSinceId());
         return getTwitter().getMentionsTimeline(getLastIdPaging());
     }
 
     @Override
     protected List<Status> doDirect() throws TwitterException {
+        log.trace("doDirect.getMentionsTimeline()");
         return getTwitter().getMentionsTimeline();
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/509eab16/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/timeline/RetweetsConsumerHandler.java
----------------------------------------------------------------------
diff --git a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/timeline/RetweetsConsumerHandler.java
b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/timeline/RetweetsConsumerHandler.java
index e603ebe..a447e8e 100644
--- a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/timeline/RetweetsConsumerHandler.java
+++ b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/timeline/RetweetsConsumerHandler.java
@@ -33,11 +33,13 @@ public class RetweetsConsumerHandler extends AbstractStatusConsumerHandler
{
 
     @Override
     protected List<Status> doPoll() throws TwitterException {
+        log.trace("doPoll.getRetweetsOfMe(sinceId={})", getLastIdPaging().getSinceId());
         return getTwitter().getRetweetsOfMe(getLastIdPaging());
     }
 
     @Override
     protected List<Status> doDirect() throws TwitterException {
+        log.trace("doDirect.getRetweetsOfMe(");
         return getTwitter().getRetweetsOfMe();
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/509eab16/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/timeline/UserConsumerHandler.java
----------------------------------------------------------------------
diff --git a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/timeline/UserConsumerHandler.java
b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/timeline/UserConsumerHandler.java
index 7f45024..effe89f 100644
--- a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/timeline/UserConsumerHandler.java
+++ b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/timeline/UserConsumerHandler.java
@@ -36,11 +36,13 @@ public class UserConsumerHandler extends AbstractStatusConsumerHandler
{
 
     @Override
     protected List<Status> doPoll() throws TwitterException {
+        log.trace("doPoll.getUserTimeline(user={}, sinceId={})", user, getLastIdPaging().getSinceId());
         return getTwitter().getUserTimeline(user, getLastIdPaging());
     }
 
     @Override
     protected List<Status> doDirect() throws TwitterException {
+        log.trace("doDirect.getUserTimeline(user={})", user);
         return getTwitter().getUserTimeline(user);
     }
 }


Mime
View raw message