convert print statements to use logging module