To run the example project, clone the repo, and run pod install
from the Example directory first.
- iOS 8.0+
- Xcode 8.0+
- Swift 3.2+
This project is inspired by AlamofireNetworkActivityLogger and facebook Stetho library. Reference: https://github.com/konkab/AlamofireNetworkActivityLogger https://github.com/facebook/stetho
The aim of this project is to log the Alamofire request and response to the Safari Web Inspector. By console log method in javascript, header and body is logged in console tab.
Console Log : Header Console Warn: Body Console Error:Error
Import the library:
import AlamofireSafariLogger
Add the following code to AppDelegate.swift application:didFinishLaunchingWithOptions:
:
AlamofireSafariLogger.shared.startLogging()
- To log iOS Device, in your device , Setting > Safari > Advanced > enable "Web Inspector"
#if DEBUG
AlamofireSafariLogger.shared.startLogging()
#endif
public var isGroupCollapse : Bool = true
public var isLogRequestHeader : Bool = true
public var isLogRequestBody : Bool = true
public var isLogResponseHeader : Bool = true
public var isLogResponseBody : Bool = true
public var isLogError : Bool = true
public var isDisableLog : Bool = false
Not Support multipart/form-data request body
AlamofireSafariLogger is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'AlamofireSafariLogger'
AlamofireSafariLogger is available under the MIT license. See the LICENSE file for more info.