# HG changeset patch # User Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com> # Date 1309507596 -7200 # Node ID 6d642d65047075af4087181e4de56f3bd5410f9b # Parent dfda2d71838b2eeaded3210c98cac628329a2a56 Improve tweet recorder log info diff -r dfda2d71838b -r 6d642d650470 script/stream/recorder_tweetstream.py --- a/script/stream/recorder_tweetstream.py Fri Jul 01 10:06:01 2011 +0200 +++ b/script/stream/recorder_tweetstream.py Fri Jul 01 10:06:36 2011 +0200 @@ -8,6 +8,7 @@ import os import socket import sys +import time import tweetstream import tweetstream.auth socket._fileobject.default_bufsize = 0 @@ -106,6 +107,7 @@ print "Stop recording after %d seconds." % (duration) break process_tweet(tweet, session, debug, token_filename) + logging.info("Tweet count: %d - current rate : %d - running : %s"%(stream.count, stream.rate, int(time.time()-stream.starttime))) session.commit() finally: stream.close() @@ -149,7 +151,7 @@ if options.new and os.path.exists(options.filename): os.remove(options.filename) - engine, metadata = models.setup_database('sqlite:///' + options.filename, echo=(options.debug)) + engine, metadata = models.setup_database('sqlite:///' + options.filename, echo=(options.debug>=2)) Session = sessionmaker(bind=engine) session = Session()