diff FeedUpdater.py @ 11:e87c54b3a216

use the logging framework for printing messages
author Dirk Olmes <dirk@xanthippe.ping.de>
date Tue, 27 Apr 2010 20:18:22 +0200
parents 01a86b178e60
children bdd1296a4b8c
line wrap: on
line diff
--- a/FeedUpdater.py	Tue Apr 27 20:08:21 2010 +0200
+++ b/FeedUpdater.py	Tue Apr 27 20:18:22 2010 +0200
@@ -3,8 +3,10 @@
 from Feed import Feed
 from FeedEntry import FeedEntry
 import feedparser
+import logging
 
 STATUS_OK = 200
+logger = logging.getLogger("FeedUpdater")
 
 def updateAllFeeds(session):
     allFeeds = session.query(Feed)
@@ -12,7 +14,7 @@
         try:
             FeedUpdater(session, feed).update()
         except FeedUpdateException:
-            print("problems while updating feed " + feed.rss_url)
+            logger.warn("problems while updating feed " + feed.rss_url)
         session.commit()
 
 class FeedUpdater(object):