Replaces print statements with logging