Skip to content

Commit ab5d58e

Browse files
sebstoCopilot
andauthored
DRY 1024
Co-authored-by: Copilot <[email protected]>
1 parent 33cec70 commit ab5d58e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/AWSLambdaRuntime/Lambda.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ public enum Lambda {
4848
let bytes = invocation.event
4949
var metadata: Logger.Metadata? = nil
5050
if logger.logLevel <= .trace,
51-
let buffer = bytes.getSlice(at: 0, length: min(bytes.readableBytes, 1024))
51+
let buffer = bytes.getSlice(at: 0, length: min(bytes.readableBytes, maxPayloadPreviewSize))
5252
{
5353
metadata = [
54-
"Event's first bytes": .string(String(buffer: buffer) + (bytes.readableBytes > 1024 ? "..." : ""))
54+
"Event's first bytes": .string(String(buffer: buffer) + (bytes.readableBytes > maxPayloadPreviewSize ? "..." : ""))
5555
]
5656
}
5757
logger.trace(

0 commit comments

Comments
 (0)