diff --git a/Sources/Phoenix/Payload.swift b/Sources/Phoenix/Payload.swift index 2467486..7cbb952 100644 --- a/Sources/Phoenix/Payload.swift +++ b/Sources/Phoenix/Payload.swift @@ -5,7 +5,14 @@ public typealias Payload = [String: Any] extension Dictionary where Key == String, Value == Any { var _debugDescription: String { let contents = self - .map { "\($0.key):\(String(describing: $0.value))" } + .map { (key, value) in + let maxLength = 32 + let valueStr = String(describing: value) + let truncatedValue = valueStr.count > maxLength ? + "\(valueStr.prefix(maxLength))..." : + valueStr + return "\(key):\(truncatedValue)" + } .joined(separator: ",") return "{\(contents)}" }