Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _log_setup(self, event, context):
if self._json_logging:
log_helper.setup(self._log_level, boto_level=self._boto_level, RequestType=event['RequestType'],
StackId=event['StackId'], RequestId=event['RequestId'],
LogicalResourceId=event['LogicalResourceId'], aws_request_id=context.aws_request_id)
else:
log_helper.setup(self._log_level, boto_level=self._boto_level, formatter_cls=None)
self.LogicalResourceId = ""
self.Data = {}
self._event = {}
self._context = None
self._response_url = ""
self._sam_local = os.getenv('AWS_SAM_LOCAL')
self._region = os.getenv('AWS_REGION')
try:
if not self._sam_local:
self._lambda_client = boto3.client('lambda', region_name=self._region)
self._events_client = boto3.client('events', region_name=self._region)
self._logs_client = boto3.client('logs', region_name=self._region)
if json_logging:
log_helper.setup(log_level, boto_level=boto_level, RequestType='ContainerInit')
else:
log_helper.setup(log_level, formatter_cls=None, boto_level=boto_level)
except Exception as e:
logger.error(e, exc_info=True)
self.init_failure(e)
def _log_setup(self, event, context):
if self._json_logging:
log_helper.setup(self._log_level, boto_level=self._boto_level, RequestType=event['RequestType'],
StackId=event['StackId'], RequestId=event['RequestId'],
LogicalResourceId=event['LogicalResourceId'], aws_request_id=context.aws_request_id)
else:
log_helper.setup(self._log_level, boto_level=self._boto_level, formatter_cls=None)
def _log_setup(self, event, context):
if self._json_logging:
log_helper.setup(self._log_level, boto_level=self._boto_level, RequestType=event['RequestType'],
StackId=event['StackId'], RequestId=event['RequestId'],
LogicalResourceId=event['LogicalResourceId'], aws_request_id=context.aws_request_id)
else:
log_helper.setup(self._log_level, boto_level=self._boto_level, formatter_cls=None)
def _log_setup(self, event, context):
if self._json_logging:
log_helper.setup(self._log_level, boto_level=self._boto_level, RequestType=event['RequestType'],
StackId=event['StackId'], RequestId=event['RequestId'],
LogicalResourceId=event['LogicalResourceId'], aws_request_id=context.aws_request_id)
else:
log_helper.setup(self._log_level, boto_level=self._boto_level, formatter_cls=None)
self.StackId = ""
self.RequestId = ""
self.LogicalResourceId = ""
self.Data = {}
self._event = {}
self._context = None
self._response_url = ""
self._sam_local = os.getenv('AWS_SAM_LOCAL')
self._region = os.getenv('AWS_REGION')
try:
if not self._sam_local:
self._lambda_client = boto3.client('lambda', region_name=self._region)
self._events_client = boto3.client('events', region_name=self._region)
self._logs_client = boto3.client('logs', region_name=self._region)
if json_logging:
log_helper.setup(log_level, boto_level=boto_level, RequestType='ContainerInit')
else:
log_helper.setup(log_level, formatter_cls=None, boto_level=boto_level)
except Exception as e:
logger.error(e, exc_info=True)
self.init_failure(e)