switches from print statements to logging