Latest 0.2.0
Homepage https://github.com/muukii/HTTPLogger
License MIT
Platforms ios 8.0, tvos 9.0, watchos 2.0, requires ARC
Authors

CI Status Version License Platform

About

Logging HTTP Request of NSURLSession.

Request Log

Response Log

Usage (Setup)

  • Register NSURLProtocol
HTTPLogger.register()
  • Setup NSURLSessionConfiguration
let configuration = NSURLSessionConfiguration.defaultSessionConfiguration()
HTTPLogger.setup(configuration)

// Sample Alamofire
Alamofire.Manager(configuration: configuration)

Custom

  • Create and Set Configuration
struct Configuration: HTTPLoggerConfigurationType {
  func printLog(string: String) {
    NSLog(string)
  }

  public func enableCapture(request: NSURLRequest) -> Bool {
    #if DEBUG
      return true
    #else
      return false
    #endif
  }
}
HTTPLogger.configuration = Configuration()

Installation

HTTPLogger is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "HTTPLogger"

Author

muukii, [email protected]

License

HTTPLogger is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "HTTPLogger",
    "version": "0.2.0",
    "summary": "Logging HTTP Request with NSURLProtocol",
    "description": "Pretty print HTTP Request with NSURLProtocol",
    "homepage": "https://github.com/muukii/HTTPLogger",
    "license": "MIT",
    "authors": {
        "muukii": "[email protected]"
    },
    "source": {
        "git": "https://github.com/muukii/HTTPLogger.git",
        "tag": "0.2.0"
    },
    "platforms": {
        "ios": "8.0",
        "tvos": "9.0",
        "watchos": "2.0"
    },
    "requires_arc": true,
    "source_files": "HTTPLogger/*.swift",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This