use of com.amazonaws.services.lambda.runtime.LambdaLogger in project aws-lambda-developer-guide by awsdocs.
the class HandlerInteger method handleRequest.
@Override
public Integer handleRequest(Integer event, Context context) {
LambdaLogger logger = context.getLogger();
// process event
logger.log("EVENT: " + gson.toJson(event));
logger.log("EVENT TYPE: " + event.getClass().toString());
// return amount of time remaining before timeout
return context.getRemainingTimeInMillis();
}
use of com.amazonaws.services.lambda.runtime.LambdaLogger in project aws-lambda-developer-guide by awsdocs.
the class HandlerString method handleRequest.
@Override
public Integer handleRequest(String event, Context context) {
LambdaLogger logger = context.getLogger();
// process event
logger.log("EVENT: " + gson.toJson(event));
logger.log("EVENT TYPE: " + event.getClass().toString());
return context.getRemainingTimeInMillis();
}
use of com.amazonaws.services.lambda.runtime.LambdaLogger in project aws-java-serverless by hermanlintvelt.
the class CreateRoadmapsHandlerTest method setUp.
@BeforeEach
public void setUp() {
subject = new CreateRoadmapsHandler();
testContext = new Context() {
@Override
public String getAwsRequestId() {
return null;
}
@Override
public String getLogGroupName() {
return null;
}
@Override
public String getLogStreamName() {
return null;
}
// implement all methods of this interface and setup your test context.
// For instance, the function name:
@Override
public String getFunctionName() {
return "ExampleAwsLambda";
}
@Override
public String getFunctionVersion() {
return null;
}
@Override
public String getInvokedFunctionArn() {
return null;
}
@Override
public CognitoIdentity getIdentity() {
return null;
}
@Override
public ClientContext getClientContext() {
return null;
}
@Override
public int getRemainingTimeInMillis() {
return 0;
}
@Override
public int getMemoryLimitInMB() {
return 0;
}
@Override
public LambdaLogger getLogger() {
return null;
}
};
}
use of com.amazonaws.services.lambda.runtime.LambdaLogger in project function-duke by ivargrimstad.
the class Hello method handleRequest.
public String handleRequest(Person person, Context context) {
LambdaLogger logger = context.getLogger();
logger.log("received : " + person.getName());
return "Hello, " + person.getName();
}
Aggregations