Changing print to log.