Changing the print to logger.warn()