Corrected conversion from print statement to logging