Closed kean closed 2 months ago
This PR adds two new standard ways for capturing network requests.
Option 1 (Quick). If you are evaluating the framework, the quickest way to get started is with NetworkLogger/enableProxy(logger:).
NetworkLogger/enableProxy(logger:)
#if DEBUG NetworkLogger.enableProxy() #endif
Option 2 (Recommended). Use URLSessionProxy, a thin wrapper on top of URLSession.
URLSessionProxy
URLSession
let session: URLSessionProtocol #if DEBUG let session: URLSessionProtocol = URLSessionProxy(configuration: .default) #else let session: URLSessionProtocol = URLSession(configuration: .default) #endif
Alternative way to exclude Pulse entirely from the build:
#if DEBUG typealias URLSessionType = URLSessionProxy #else typealias URLSessionType = URLSession #endif
This PR adds two new standard ways for capturing network requests.
Option 1 (Quick). If you are evaluating the framework, the quickest way to get started is with
NetworkLogger/enableProxy(logger:)
.Option 2 (Recommended). Use
URLSessionProxy
, a thin wrapper on top ofURLSession
.Alternative way to exclude Pulse entirely from the build: