From d7dd987b8760eb3c492b10940190a9cb24a6d3c9 Mon Sep 17 00:00:00 2001 From: sbertix Date: Sun, 21 Mar 2021 16:08:55 +0100 Subject: [PATCH] Fix request not being logged --- Sources/ComposableRequest/Publishers/Publisher+Request.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/ComposableRequest/Publishers/Publisher+Request.swift b/Sources/ComposableRequest/Publishers/Publisher+Request.swift index e7e817a7..ea37f3ab 100644 --- a/Sources/ComposableRequest/Publishers/Publisher+Request.swift +++ b/Sources/ComposableRequest/Publishers/Publisher+Request.swift @@ -24,9 +24,9 @@ public extension Request { .retry(max(input.retries, 0)) .map(Request.Response.init) .handleEvents( + receiveSubscription: { _ in logger.log(request: request) }, receiveOutput: { logger.log(.success($0)) }, - receiveCompletion: { if case .failure(let error) = $0 { logger.log(.failure(error)) }}, - receiveRequest: { if $0.max ?? 0 > 0 { logger.log(request: request) }} + receiveCompletion: { if case .failure(let error) = $0 { logger.log(.failure(error)) }} ) .catch { Fail(error: $0) } .eraseToAnyPublisher()