Giter Club home page Giter Club logo

guppy-ios's Introduction

Guppy

Platform Swift Version CocoaPods Carthage compatible codecov License

Do you want to know what's tedious? Debugging network requests and responses if you don't have the right tools. Guppy is a logging tool focused on HTTP requests that can be easily plugged into any iOS application. Guppy will intercept and log each network request sent from the app. You can access any Guppy log and share it with the rest of your team effortlessly.

Usage

While in the simulator you can use: ^ + โŒ˜ + z to bring up Guppy or shake your phone.

Routes

You can dig deep into the details of your network logs and share them with your team or yourself.

Details

Example

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

URLSession

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        
        Guppy.registerURLProtocol()
        
        return true
    }
}

URLSession with Custom Protocols

class Session: URLSession {
    
    init() {
        let configuration = URLSessionConfiguration.default
        
        configuration.urlCache = nil
        
        // Protocols are evaluated in reverse order
        // If GuppyURLProtocol is not the last protocol it is not guaranteed to be executed
        configuration.protocolClasses = [MyCustomProtocol, GuppyURLProtocol.self]
        
        super.init(configuration: configuration)
    }
}

Alamofire

class SessionManager: Alamofire.SessionManager {

    init() {
        let configuration = URLSessionConfiguration.default

        configuration.urlCache = nil
        configuration.protocolClasses = [GuppyURLProtocol.self]
        
        super.init(configuration: configuration)
    }
}

Requirements

  • Xcode 12.0+
  • iOS 13.0+

Installation

Guppy is best used in non-production environments. By default, installing the Guppy framework will automatically make it available when the user shakes their device. To avoid this do any combination of the following:

  • If you are using multiple targets for different environments, only include the Guppy framework in the non-production targets
  • If you are using one target with multiple configurations for different environments, only include the Guppy framework in the non-production configuration
  • Set Guppy.shared.showOnShake = false in your didFinishLaunchingWithOptions for the specific times where Guppy should not be available
https://github.com/johnsonandjohnson/Guppy-iOS.git
pod 'Guppy'
github "johnsonandjohnson/Guppy-iOS"

License

Guppy is released under the Apache 2.0 license. See LICENSE for details.

guppy-ios's People

Contributors

bfwalton avatar dspaces1 avatar schayes04 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

guppy-ios's Issues

JSON UI

View JSON response/requests in a more readable format

Memory Leak

Instances of SniffURLProtocol are retained after the requests are completed

Custom Logging

Refactor Guppy to allow for a custom logging protocol

Linting

  • Add swift lint
  • Ensure CI checks for linting issues before merge

Add a pending state for requests

While trying the example project I hit some requests and some didn't show up in Guppy's screen. After opening and closing Guppy's screen multiple times they eventually showed up.

It would be nice if there is a pending state.

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.