Replace a print statement by a call to logging