Convert more printing to logging.