INNER CODE UNIT · Python

lambda_handler

mlevit/aws-auto-cleanup · app/src/main.py:568

def lambda_handler(event, context):
    # enable logging
    root = logging.getLogger()

    if root.handlers:
        for handler in root.handlers:
            root.removeHandler(handler)

    logging.getLogger("boto3").setLevel(logging.ERROR)
    logging.getLogger("botocore").setLevel(logging.ERROR)
    logging.getLogger("urllib3").setLevel(logging.ERROR)

    logging.basicConfig(
        format="[%(levelname)s] %(message)s (%(filename)s, %(funcName)s(), line %(lineno)d)",
        level=os.environ.get("LOG_LEVEL", "WARNING").upper(),
    )

    # create instance of class

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…