AlamofireLogbook 0.1.1

AlamofireLogbook 0.1.1

Maintained by mikeAttia.



  • By
  • mikeAttia

📒 AlamofireLogbook

An Alamofire network activity logger view

Version MIT license Platform Swift Version PRs Welcome

Installation

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

pod 'AlamofireLogbook'

Usage

To start logging, import the libraray in your network layer and use the method log() on your Alamofire DataRequest instance like the following example:

import Alamofire
import AlamofireLogbook

Alamofire
.request("https://httpbin.org/get")
.log()
.responseJSON { response in
// Your code
}

If you want to log each request yourself

  1. Conform to AlamofireResponseListener
  2. implement
recievedResponseFor(item : LogItem)
  1. assign your delegate class in the app delegate to AlamofireLogbook.shared.delegate

OR to show the Network activity logs view just call

AlamofireLogbook.show()

and you'll get A full searchable log

screenshot_01 screenshot_02 screenshot_03 screenshot_04

💡Tip

Use the action button on the top right of the request details page to copy a readable formatted string of both the request and response. 😉

Example

To try the example project:

run pod try AlamofireLogbook in your ternimal

or

clone the repo, and run pod install from the Example directory first.

Requirements

  • iOS 9.0+
  • Xcode 9+
  • Swift 3.2+
  • AlamofireLogbook is a plugin for Alamofire framework

Contributions

If you have some ideas on how to improve the framework, Fork it, implement your changes and create that pull request already 😉.

All contributions are welcome 🤗.

Author

Built with 💙 by mikeAttia

License

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