Latest 1.0.3
Homepage https://github.com/springwong/AlamofireSafariLogger
License MIT
Platforms ios 8.0
Dependencies Alamofire
Authors

AlamofireSafariLogger – a lightweight Alamofire call debugger

CI Status
Version
License
Platform

Example

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

Requirements

  • iOS 8.0+
  • Xcode 8.0+
  • Swift 3.2+

Usage

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()

Open Safari , enable developer menu.

Open Debugger

Open web inspector in developer menu when your app is running.

Example Image

!!!Remember to prevent library’s execution in your production app

Features

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

Installation

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

pod 'AlamofireSafariLogger'

Author

[email protected]

License

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

Latest podspec

{
    "name": "AlamofireSafariLogger",
    "version": "1.0.3",
    "summary": "A logging library under Alamofire library. Allow user to view logging information in Safari Web Inspector.",
    "description": "A logging library under Alamofire library. Allow user to view logging information in Safari Web Inspector.nPlease reference to https://github.com/springwong/AlamofireSafariLogger",
    "homepage": "https://github.com/springwong/AlamofireSafariLogger",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Spring": "[email protected]"
    },
    "source": {
        "git": "https://github.com/springwong/AlamofireSafariLogger.git",
        "tag": "1.0.3"
    },
    "platforms": {
        "ios": "8.0"
    },
    "swift_version": "3.2",
    "source_files": "AlamofireSafariLogger/Classes/**/*",
    "dependencies": {
        "Alamofire": [
            "~> 4.5"
        ]
    }
}

Pin It on Pinterest

Share This