import logging


def _make_logger(name, /, level='error'):
    """
    Return a logger.
    """
    # See: https://stackoverflow.com/q/43109355/4970632
    handler = logging.StreamHandler()
    handler.setFormatter(logging.Formatter('%(name)s (%(levelname)s): %(message)s'))
    logger = logging.getLogger(name)
    logger.addHandler(handler)
    logger.setLevel(getattr(logging, level.upper()))  # logging.ERROR or logging.INFO
    return logger