Git Product home page Git Product logo

alamofirelogbook's Introduction

📒 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.

alamofirelogbook's People

Contributors

mikedaoud avatar

Stargazers

Yunus Tek avatar zhiqingchun avatar 麦志超 avatar Marko Nazmy avatar  avatar  avatar ahmed mohsen avatar  avatar Mohamed Abdul-Hameed avatar  avatar samy avatar Mohamed Farouk avatar

Watchers

 avatar

Forkers

huangjiaju omiz

alamofirelogbook's Issues

Add support for persistence

Hey, awesome lib! It's really helpful. To be even better, would be cool the add an option to persist the request/response somehow (with userdefaults or keychain), even if the user closes the app. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.