This repository was archived by the owner on Apr 23, 2021. It is now read-only.
File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -166,6 +166,16 @@ public struct DefaultContext: Context {
166
166
// MARK: `with...` functions
167
167
168
168
extension DefaultContext {
169
+ /// Fluent API allowing for modification of underlying logger when passing the context to other functions.
170
+ ///
171
+ /// - Parameter logger: Logger that should replace the underlying logger of this context.
172
+ /// - Returns: new context, with the passed in `logger`
173
+ public func withLogger( _ logger: Logger ) -> DefaultContext {
174
+ var copy = self
175
+ copy. logger = logger
176
+ return copy
177
+ }
178
+
169
179
/// Fluent API allowing for modification of underlying logger when passing the context to other functions.
170
180
///
171
181
/// - Parameter logger: Logger that should replace the underlying logger of this context.
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ extension BaggageTests {
31
31
( " testSingleKeyBaggageDescription " , testSingleKeyBaggageDescription) ,
32
32
( " testMultiKeysBaggageDescription " , testMultiKeysBaggageDescription) ,
33
33
( " test_todo_context " , test_todo_context) ,
34
- ( " test_todo_empty " , test_todo_empty ) ,
34
+ ( " test_topLevel " , test_topLevel ) ,
35
35
]
36
36
}
37
37
}
You can’t perform that action at this time.
0 commit comments