import logging


def _setup_text_logger(name, stream, level):
    """Setup a text logger."""
    res = logging.getLogger(name)
    handler = logging.StreamHandler(stream)
    handler.setFormatter(logging.Formatter(fmt="%(message)s"))
    res.addHandler(handler)
    res.setLevel(level)
    return res