Skip to content

Commit 1e901b9

Browse files
committed
Make Task.logger accessible to delegate implementations outside of Package
Motivation: This change was proposed in issue [swift-server#389](swift-server#389). Users writing their own `HttpClientResponseDelegate` implementation might want to emit log messages to the `task`'s `logger`. Modifications: Changed the access level of `Task`'s `logger` property from `internal` to `public`. Result: Users can access the `logger` property of a `Task` outside of the `async-http-client`.
1 parent 2442598 commit 1e901b9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/AsyncHTTPClient/HTTPHandler.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -565,9 +565,10 @@ extension HTTPClient {
565565
public final class Task<Response> {
566566
/// The `EventLoop` the delegate will be executed on.
567567
public let eventLoop: EventLoop
568+
/// The `Logger` used by the `Task` for logging.
569+
public let logger: Logger // We are okay to store the logger here because a Task is for only one request.
568570

569571
let promise: EventLoopPromise<Response>
570-
let logger: Logger // We are okay to store the logger here because a Task is for only one request.
571572

572573
var isCancelled: Bool {
573574
self.lock.withLock { self._isCancelled }

0 commit comments

Comments
 (0)