def get_write_method(logger):
    """Generate write method for logger."""

    def write(msg: str):
        if msg == '\n':
            return

        for it in msg.split('\n'):
            logger.info(it)

    return write