switch print statements to logger