Commits

Gregory Petukhov  committed bbeee67

Small changes to logging in mongo queue backend

  • Participants
  • Parent commits d9e9d76

Comments (0)

Files changed (2)

File grab/spider/queue_backend/mongo.py

         self.queue_name = queue_name
         conn = pymongo.Connection(**kwargs)
         self.collection = conn[self.database][self.queue_name]
+        logging.debug('Using collection: %s' % self.collection)
         self.clear_on_init = clear_on_init
         self.clear_on_exit = clear_on_exit
 
             self.clear_collection()
 
     def clear_collection(self):
-        logger.debug('Deleting mongo collection: %s' % self.collection)
+        logger.debug('Deleting collection: %s' % self.collection)
         self.collection.drop()
 
     def size(self):

File test_spider_simple.py

     logging.basicConfig(level=logging.DEBUG)
     bot = TestSpider(thread_number=4)
     bot.setup_queue(backend='mongo', database='grab_test')
+    #bot.setup_queue(backend='mongo', database='grab_test', queue_name='foo',
+                    #clear_on_init=True, clear_on_exit=True)
     #bot.setup_queue(backend='memory')
     bot.run()