Latest 2.4.0
Homepage https://github.com/konkab/AlamofireNetworkActivityLogger
License MIT
Platforms ios 9.0, osx 10.11, tvos 9.0, watchos 2.0
Dependencies Alamofire
Authors

CocoaPods Compatible
Carthage Compatible
Platform

Network activity logger for Alamofire.

Requirements

  • iOS 9.0+ / macOS 10.11+ / tvOS 9.0+ / watchOS 2.0+
  • Xcode 8.0+
  • Swift 3.2+

Dependencies

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods 1.6.0+ is required.

To integrate AlamofireNetworkActivityLogger into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!

pod 'AlamofireNetworkActivityLogger', '~> 2.4'

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate AlamofireNetworkActivityLogger into your Xcode project using Carthage, specify it in your Cartfile:

github "konkab/AlamofireNetworkActivityLogger" ~> 2.4

Usage

Import the library:

import AlamofireNetworkActivityLogger

Add the following code to AppDelegate.swift application:didFinishLaunchingWithOptions::

NetworkActivityLogger.shared.startLogging()

Now all NSURLSessionTask objects created by an Alamofire.SessionManager will have their request and response logged to the console, a la:

---------------------
GET 'http://example.com/foo/bar.json'
---------------------
200 'http://example.com/foo/bar.json' [0.2535 s]

If the default logging level is too verbose—say, if you only want to know when requests fail—then changing it is as simple as:

NetworkActivityLogger.shared.level = .error

Contact

Konstantin Kabanov

License

AlamofireNetworkActivityLogger is released under the MIT license. See LICENSE for details.

Latest podspec

{
    "name": "AlamofireNetworkActivityLogger",
    "version": "2.4.0",
    "license": "MIT",
    "summary": "Network request logger for Alamofire",
    "homepage": "https://github.com/konkab/AlamofireNetworkActivityLogger",
    "social_media_url": "https://www.linkedin.com/in/konstantinkabanov",
    "authors": {
        "Konstantin Kabanov": "[email protected]"
    },
    "source": {
        "git": "https://github.com/konkab/AlamofireNetworkActivityLogger.git",
        "tag": "2.4.0"
    },
    "source_files": "Source/*.swift",
    "platforms": {
        "ios": "9.0",
        "osx": "10.11",
        "tvos": "9.0",
        "watchos": "2.0"
    },
    "dependencies": {
        "Alamofire": [
            "~> 4.8"
        ]
    }
}

Pin It on Pinterest

Share This