Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure TRACE log level exists in runtime v2 #404

Open
sebsto opened this issue Oct 10, 2024 · 1 comment
Open

Make sure TRACE log level exists in runtime v2 #404

sebsto opened this issue Oct 10, 2024 · 1 comment

Comments

@sebsto
Copy link
Contributor

sebsto commented Oct 10, 2024

Verify if this change has been kept in v2
2219782

@sebsto
Copy link
Contributor Author

sebsto commented Oct 10, 2024

@fabianfett

This is the code for 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant