camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [7/8] camel git commit: Added a bit of logging
Date Wed, 05 Jul 2017 09:27:05 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/9d8b2cbf
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/9d8b2cbf
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/9d8b2cbf

Branch: refs/heads/camel-2.18.x
Commit: 9d8b2cbf46d75c421e561e43dc1f3a3e4f18fb1c
Parents: e0c5b14
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 11:26:06 2017 +0200

----------------------------------------------------------------------
 .../apache/camel/component/twitter/consumer/TwitterConsumer.java | 4 ++++
 .../twitter/consumer/timeline/AbstractStatusConsumer.java        | 2 +-
 .../camel/component/twitter/consumer/timeline/HomeConsumer.java  | 2 ++
 .../component/twitter/consumer/timeline/MentionsConsumer.java    | 2 ++
 .../component/twitter/consumer/timeline/RetweetsConsumer.java    | 2 ++
 .../camel/component/twitter/consumer/timeline/UserConsumer.java  | 2 ++
 6 files changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/9d8b2cbf/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/TwitterConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/TwitterConsumer.java
b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/TwitterConsumer.java
index b1d9b37..ca877c7 100644
--- a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/TwitterConsumer.java
+++ b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/TwitterConsumer.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 TwitterConsumer {
 
+    protected final Logger log = LoggerFactory.getLogger(this.getClass());
+
     /**
      * Instance of TwitterEndpoint.
      */

http://git-wip-us.apache.org/repos/asf/camel/blob/9d8b2cbf/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/AbstractStatusConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/AbstractStatusConsumer.java
b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/AbstractStatusConsumer.java
index 18f0aee..64d6679 100644
--- a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/AbstractStatusConsumer.java
+++ b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/AbstractStatusConsumer.java
@@ -36,7 +36,7 @@ abstract class AbstractStatusConsumer extends TwitterConsumer {
 
     @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/9d8b2cbf/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/HomeConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/HomeConsumer.java
b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/HomeConsumer.java
index 252bacc..0b2a934 100644
--- a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/HomeConsumer.java
+++ b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/HomeConsumer.java
@@ -33,11 +33,13 @@ public class HomeConsumer extends AbstractStatusConsumer {
 
     @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/9d8b2cbf/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/MentionsConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/MentionsConsumer.java
b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/MentionsConsumer.java
index c3671c8..cf07350 100644
--- a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/MentionsConsumer.java
+++ b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/MentionsConsumer.java
@@ -33,11 +33,13 @@ public class MentionsConsumer extends AbstractStatusConsumer {
 
     @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/9d8b2cbf/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/RetweetsConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/RetweetsConsumer.java
b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/RetweetsConsumer.java
index dfd0815..585cff9 100644
--- a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/RetweetsConsumer.java
+++ b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/RetweetsConsumer.java
@@ -33,11 +33,13 @@ public class RetweetsConsumer extends AbstractStatusConsumer {
 
     @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/9d8b2cbf/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/UserConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/UserConsumer.java
b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/UserConsumer.java
index 51ef02a..ab20665 100644
--- a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/UserConsumer.java
+++ b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/UserConsumer.java
@@ -33,11 +33,13 @@ public class UserConsumer extends AbstractStatusConsumer {
 
     @Override
     protected List<Status> doPoll() throws TwitterException {
+        log.trace("doPoll.getUserTimeline(user={}, sinceId={})", endpoint.getProperties().getUser(),
getLastIdPaging().getSinceId());
         return getTwitter().getUserTimeline(endpoint.getProperties().getUser(), getLastIdPaging());
     }
 
     @Override
     protected List<Status> doDirect() throws TwitterException {
+        log.trace("doDirect.getUserTimeline(user={})", endpoint.getProperties().getUser());
         return getTwitter().getUserTimeline(endpoint.getProperties().getUser());
     }
 }


Mime
View raw message