Created
July 29, 2018 14:19
-
-
Save dotarr/faf92fbe398c427e411e53830b902317 to your computer and use it in GitHub Desktop.
Lambda Harness
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Basic script to set up environment variables and call a lambda entry point so | |
that it can be ran locally | |
""" | |
import logging | |
import os | |
import sys | |
import my_lambda as ml | |
logger = logging.getLogger() | |
logger.setLevel(logging.DEBUG) | |
#################[SET ENVIRONMENT VARIABLES]################# | |
os.environ['my_var'] = 'blah' | |
############################################################# | |
#harness to pipe logging to stdout | |
ch = logging.StreamHandler(sys.stdout) | |
ch.setLevel(logging.DEBUG) | |
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') | |
ch.setFormatter(formatter) | |
logger.addHandler(ch) | |
ml.handle_event('blah','blah') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment