Use logging instead of print, and add more info logging.