swift-aws-lambda-runtime
swift-aws-lambda-runtime copied to clipboard
Make sure TRACE log level exists in runtime v2
Verify if this change has been kept in v2 https://github.com/swift-server/swift-aws-lambda-runtime/commit/221978224cf82027f46c0aa54def83476fb74412
@fabianfett
This is the code from v1
// when log level is trace or lower, print the first Kb of the payload
if logger.logLevel <= .trace, let buffer = bytes.getSlice(at: 0, length: max(bytes.readableBytes, 1024)) {
logger.trace("sending invocation to lambda handler",
metadata: ["1024 first bytes": .string(String(buffer: buffer))])
} else {
logger.debug("sending invocation to lambda handler")
}
Where is the good place to add this code ?
Is it in Lambda.runLoop() ?
https://github.com/swift-server/swift-aws-lambda-runtime/blob/main/Sources/AWSLambdaRuntimeCore/Lambda.swift#L39
Or in the Handler ? https://github.com/swift-server/swift-aws-lambda-runtime/blob/main/Sources/AWSLambdaRuntimeCore/LambdaHandlers.swift#L172