Mercurial > hg > Feedworm
diff feedupdate-main.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 | 87317ba41816 |
children | 9ede118b93ef |
line wrap: on
line diff
--- a/feedupdate-main.py Tue Apr 27 20:08:21 2010 +0200 +++ b/feedupdate-main.py Tue Apr 27 20:18:22 2010 +0200 @@ -4,10 +4,13 @@ from Feed import Feed from FeedUpdater import updateAllFeeds import Mapping +import logging import socket from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker +logger = logging.getLogger("feedupdater") + def loadDatabaseProperties(): hostname = socket.gethostname() filename = "database-%s.ini" % hostname @@ -25,7 +28,7 @@ def listFeeds(session): allFeeds = session.query(Feed) for feed in allFeeds: - print "\n\nfeed: " + feed.name + logger.info("feed: " + feed.name) for entry in feed.entries: print entry.title