import logging


def file_logger_factory(file, name):
    """Create a logger that writes to a file
    """
    formatter = logging.Formatter("%(message)s")

    handler = logging.FileHandler(file, mode="w")
    handler.setFormatter(formatter)

    logger = logging.getLogger(name)
    logger.addHandler(handler)
    logger.setLevel(logging.INFO)
    logger.propagate = False
    return logger