com.amazonaws.services.lambda.runtime.LambdaRuntime Java Examples
The following examples show how to use
com.amazonaws.services.lambda.runtime.LambdaRuntime.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractMicronautLambdaRuntime.java From micronaut-aws with Apache License 2.0 | 5 votes |
/** * @param level Log Level * @param msg Message to log */ protected void log(LogLevel level, String msg) { boolean shouldLog = false; if (level == LogLevel.ALL) { shouldLog = true; } else if (level == LogLevel.OFF || level == LogLevel.NOT_SPECIFIED) { shouldLog = false; } else if (getLogLevel().ordinal() <= level.ordinal()) { shouldLog = true; } if (shouldLog) { LambdaRuntime.getLogger().log(msg); } }
Example #2
Source File: AmazonLambdaContext.java From quarkus with Apache License 2.0 | 5 votes |
public AmazonLambdaContext(HttpURLConnection request, ObjectReader cognitoReader, ObjectReader clientCtxReader) throws IOException { awsRequestId = request.getHeaderField(LAMBDA_RUNTIME_AWS_REQUEST_ID); logGroupName = logGroupName(); logStreamName = logStreamName(); functionName = functionName(); functionVersion = functionVersion(); invokedFunctionArn = request.getHeaderField(LAMBDA_RUNTIME_INVOKED_FUNCTION_ARN); String cognitoIdentityHeader = request.getHeaderField(LAMBDA_RUNTIME_COGNITO_IDENTITY); if (cognitoIdentityHeader != null) { cognitoIdentity = cognitoReader.readValue(cognitoIdentityHeader); } String clientContextHeader = request.getHeaderField(LAMBDA_RUNTIME_CLIENT_CONTEXT); if (clientContextHeader != null) { clientContext = clientCtxReader.readValue(clientContextHeader); } String functionMemorySize = functionMemorySize(); memoryLimitInMB = functionMemorySize != null ? Integer.valueOf(functionMemorySize) : 0; String runtimeDeadline = request.getHeaderField(LAMBDA_RUNTIME_DEADLINE_MS); if (runtimeDeadline != null) { runtimeDeadlineMs = Long.valueOf(runtimeDeadline); } logger = LambdaRuntime.getLogger(); }
Example #3
Source File: RuntimeContext.java From micronaut-aws with Apache License 2.0 | 4 votes |
@Override public LambdaLogger getLogger() { return LambdaRuntime.getLogger(); }