def start_logger(logger_name, log_level, container_id):
    """

    Initialize logging of this process and set logger format

    :param logger_name: The name to report with
    :param log_level: The verbosity level. This should be selected
    """
    logging.raiseExceptions = False
    log_level = log_level.upper()

    if (log_level == 'DEBUG'):
        level = logging.DEBUG
    elif (log_level == 'INFO'):
        level = logging.INFO
    elif (log_level == 'WARNING'):
        level = logging.WARN
    elif (log_level == 'CRITICAL'):
        level = logging.CRITICAL
    else:
        level = logging.ERROR

    logger = logging.getLogger("CONT #" + container_id + ": " + logger_name)

    if log_level == 'OFF':
        logging.disable(logging.CRITICAL)
    else:
        logger.setLevel(level)

    for i in range(0, 4):
        try:
            sysLogh = SysLogHandler('/dev/log')
            break
        except Exception as e:
            if i < 3:
                time.sleep(1)
            else:
                raise e

    str_format = '%(name)-12s: %(levelname)-8s %(funcName)s' + \
                 ' %(lineno)s [%(process)d, %(threadName)s]' + \
                 ' %(message)s'
    formatter = logging.Formatter(str_format)
    sysLogh.setFormatter(formatter)
    sysLogh.setLevel(level)
    logger.addHandler(sysLogh)
    return logger
dataset/ETHPy150Open openstack/storlets/Engine/storlet_daemon_factory/daemon_factory.py/start_logger/original