import logging


def _generate_log_handler(log_level: int, log_format: str) -> logging.Handler:
    """Generates a log handler given the log level and log format
    """
    log_handler = logging.StreamHandler()
    log_handler.setLevel(log_level)

    formatter = logging.Formatter(fmt=log_format, datefmt="%Y-%m-%d %H:%M:%S")
    log_handler.setFormatter(formatter)

    return log_handler