Convert print statements to logging