LoggingInterceptor
public final class LoggingInterceptor : Interceptor
Implementation of a request interceptor which logs the request information.
-
# Summary The initialiser for the
LoggingRequestInterceptorDeclaration
Swift
public init(logger: Logger = DefaultLogger())Parameters
loggerThe logger to be used to pass the request information to. Default value for the logger is the
DefaultLogger. -
# Summary Intercepting the request by taking its information and creating a message to be logged.
Declaration
Swift
public func intercept(_ request: URLRequest) -> URLRequestParameters
requestThe request to be intercepted.
Return Value
The intercepted request.
-
# Summary Intercepting the response by taking its information and creating a message to be logged.
Declaration
Swift
public func intercept(response: URLResponse?, data: Data?, error: Error?) -> URLResponse?Parameters
responseThe response returned by the data task
dataThe data returned by the data task.
errorThe error returned by the data task.
Return Value
The intercepted response.
View on GitHub
Install in Dash
LoggingInterceptor Class Reference