12
12
//
13
13
//===----------------------------------------------------------------------===//
14
14
15
+ import BaggageContext
15
16
import Dispatch
16
17
import Logging
17
18
import NIO
18
- import BaggageContext
19
19
20
20
// MARK: - InitializationContext
21
21
@@ -51,7 +51,6 @@ extension Lambda {
51
51
/// Lambda runtime context.
52
52
/// The Lambda runtime generates and passes the `Context` to the Lambda handler as an argument.
53
53
public final class Context : BaggageContext . Context , CustomDebugStringConvertible {
54
-
55
54
/// Contains contextual metadata such as request and trace identifiers, along with other information which may
56
55
/// be carried throughout asynchronous and cross-node boundaries (e.g. through HTTPClient calls).
57
56
public let baggage : Baggage
@@ -84,6 +83,7 @@ extension Lambda {
84
83
public var logger : Logger {
85
84
self . _logger. with ( self . baggage)
86
85
}
86
+
87
87
private var _logger : Logger
88
88
89
89
/// The `EventLoop` the Lambda is executed on. Use this to schedule work with.
@@ -161,7 +161,6 @@ extension Lambda {
161
161
// MARK: - Baggage Items
162
162
163
163
extension Baggage {
164
-
165
164
// MARK: - Baggage: RequestID
166
165
167
166
enum LambdaRequestIDKey : Key {
@@ -172,9 +171,9 @@ extension Baggage {
172
171
/// The request ID, which identifies the request that triggered the function invocation.
173
172
public internal( set) var lambdaRequestID : String {
174
173
get {
175
- return self [ LambdaRequestIDKey . self] ! // !-safe, the runtime guarantees to always set an identifier, even in testing
174
+ self [ LambdaRequestIDKey . self] ! // !-safe, the runtime guarantees to always set an identifier, even in testing
176
175
}
177
- set {
176
+ set {
178
177
self [ LambdaRequestIDKey . self] = newValue
179
178
}
180
179
}
@@ -189,11 +188,10 @@ extension Baggage {
189
188
/// The AWS X-Ray tracing header.
190
189
public internal( set) var lambdaTraceID : String {
191
190
get {
192
- return self [ LambdaTraceIDKey . self] ! // !-safe, the runtime guarantees to always set an identifier, even in testing
191
+ self [ LambdaTraceIDKey . self] ! // !-safe, the runtime guarantees to always set an identifier, even in testing
193
192
}
194
193
set {
195
194
self [ LambdaTraceIDKey . self] = newValue
196
195
}
197
196
}
198
-
199
197
}
0 commit comments