java - Prevent twitter4j from printing output when displaying a Twitter stream -


how go getting live twitter feed (or whatever part of twitter provides, 1% hear) using twitter4j without having twitter4j print console output? although thought mean 1 had turn off logging, trying turn off logging has not helped. prefer "in-code" solution 1 require me pass vm argument.

an sscce problem i'm facing be:

import twitter4j.*;  public class streamtweets {         public static void main(string[] args) {                     statuslistener listener = new statuslistener(){             public void onstatus(status status) {                 // whatever want here             }             public void ondeletionnotice(statusdeletionnotice statusdeletionnotice) {}             public void ontracklimitationnotice(int numberoflimitedstatuses) {}             public void onexception(exception ex) {                 ex.printstacktrace();             }             public void onscrubgeo(long arg0, long arg1) {}             public void onstallwarning(stallwarning arg0) {}         };          twitterstream twitterstream = new twitterstreamfactory().getinstance();         twitterstream.addlistener(listener);         twitterstream.sample();     } } 

nb: whatever require done, entail storing database, doing in onstatus() method of statuslistener(). not sure relevant, thought i'd put out there in case.

if providing twitter credentials through twitter4j.properties mentioned here, change first line of twitter4j.properties file to

debug=false 

this stop printing console on receiving twitter stream!


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -