move print statement to logging