Convert warnings.warn into logging.warn