Replace some print statements with logging calls.

This commit is contained in:
Lance Edgar 2015-02-23 16:02:47 -06:00
parent 4ac4193200
commit 1289a42e4b

View file

@ -797,13 +797,10 @@ class PurgeBatchesCommand(Subcommand):
from rattail.db.util import obfuscate_url_pw from rattail.db.util import obfuscate_url_pw
from rattail.db.batches import util from rattail.db.batches import util
self.stdout.write("Purging batches from database:\n") log.info("purging batches from database: {0}".format(obfuscate_url_pw(Session.kw['bind'].url)))
self.stdout.write(" {0}\n".format(obfuscate_url_pw(Session.kw['bind'].url)))
normal = util.purge_batches(effective_date=args.date, purge_everything=args.all) normal = util.purge_batches(effective_date=args.date, purge_everything=args.all)
orphaned = util.purge_orphaned_batches() orphaned = util.purge_orphaned_batches()
log.info("purged {0} normal and {1} orphaned batches".format(normal, orphaned))
self.stdout.write("\nPurged {0} normal and {1} orphaned batches.\n".format(normal, orphaned))
def main(*args): def main(*args):