import logging
import sys


def get_logger(name: str, log_level: str = 'info') -> logging.Logger:
    """Return a logger with the given name and logging level set"""
    handler = logging.StreamHandler(sys.stdout)
    log = logging.getLogger(name)
    log_level = log_level.lower()
    if log_level == 'debug':
        log.setLevel(logging.DEBUG)
        handler.setLevel(logging.DEBUG)
    elif log_level == 'warning':
        log.setLevel(logging.WARNING)
        handler.setLevel(logging.WARNING)
    elif log_level == 'error':
        log.setLevel(logging.ERROR)
        handler.setLevel(logging.ERROR)
    elif log_level == 'critical':
        log.setLevel(logging.CRITICAL)
        handler.setLevel(logging.CRITICAL)
    else:
        log.setLevel(logging.INFO)
        handler.setLevel(logging.INFO)

    formatter = logging.Formatter(
        '%(asctime)s - %(funcName)s - %(lineno)i [%(levelname)s] %(message)s')
    handler.setFormatter(formatter)
    log.addHandler(handler)
    log.propagate = False
    return log
