

def setup_logger(sns_arn, log_level=logging.DEBUG):
    ' Set up logging for openaddr code.\n    '
    if _logger_status['set up']:
        return
    else:
        _logger_status['set up'] = True
    openaddr_logger = logging.getLogger('openaddr')
    log_format = '%(asctime)s %(levelname)07s: %(message)s'
    openaddr_logger.setLevel(log_level)
    handler1 = logging.StreamHandler()
    handler1.setLevel(log_level)
    handler1.setFormatter(logging.Formatter(handler1))
    openaddr_logger.addHandler(handler1)
    try:
        handler2 = SnsHandler(sns_arn)
    except:
        openaddr_logger.warning('Failed to authenticate SNS handler')
    else:
        handler2.setLevel(logging.ERROR)
        handler2.setFormatter(logging.Formatter(log_format))
        openaddr_logger.addHandler(handler2)

dataset/ETHPy150Open openaddresses/machine/openaddr/ci/__init__.py setup_logger/VarMisuse@84/160 `log_format`->`handler1`