Replace print statements with logging calls