replaces print statements with logging