Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/digipolitan/alamofire-logging
HTTP Logging support for Alamofire
https://github.com/digipolitan/alamofire-logging
alamofire carthage cocoapods logger logging swift
Last synced: about 23 hours ago
JSON representation
HTTP Logging support for Alamofire
- Host: GitHub
- URL: https://github.com/digipolitan/alamofire-logging
- Owner: Digipolitan
- License: bsd-3-clause
- Created: 2017-08-24T12:40:58.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-10T01:23:30.000Z (about 6 years ago)
- Last Synced: 2024-12-30T23:00:42.124Z (18 days ago)
- Topics: alamofire, carthage, cocoapods, logger, logging, swift
- Language: Swift
- Homepage:
- Size: 104 KB
- Stars: 6
- Watchers: 6
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
Alamofire+Logging
=================================[![Swift Version](https://img.shields.io/badge/swift-4.2-orange.svg?style=flat)](https://developer.apple.com/swift/)
[![Build Status](https://travis-ci.org/Digipolitan/alamofire-logging.svg?branch=master)](https://travis-ci.org/Digipolitan/alamofire-logging)
[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/AlamofireLogging.svg)](https://img.shields.io/cocoapods/v/AlamofireLogging.svg)
[![Carthage Compatible](https://img.shields.io/badge/carthage-compatible-brightgreen.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Swift Package Manager Compatible](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg?style=flat)](https://swift.org/package-manager/)
[![Platform](https://img.shields.io/cocoapods/p/AlamofireLogging.svg?style=flat)](http://cocoadocs.org/docsets/AlamofireLogging)
[![Twitter](https://img.shields.io/badge/[email protected]?style=flat)](http://twitter.com/Digipolitan)Logging support for Alamofire
## Installation
### CocoaPods
To install Alamofire+Logging with CocoaPods, add the following lines to your `Podfile`.
```ruby
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!pod 'AlamofireLogging'
```### Carthage
[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
You can install Carthage with [Homebrew](http://brew.sh/) using the following command:
```bash
$ brew update
$ brew install carthage
```To integrate Alamofire+Logging into your Xcode project using Carthage, specify it in your `Cartfile`:
```
github 'Digipolitan/alamofire-logging' ~> 1.0
```Run `carthage update` to build the framework and drag the built `AlamofireLogging.framework` into your Xcode project.
### Swift Package Manager
The [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler.
Once you have your Swift package set up, adding Alamofire+Logging as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.
```swift
dependencies: [
.package(url: "https://github.com/Digipolitan/alamofire-logging.git", from: "1.0.0")
]
```## How to use ?
```swift
SessionManager.default.request("http://date.jsontest.com").log(level: .verbose).responseJSON { (response) in
switch response.result {
case .success(let value):
print("Alamofire \(value)")
case .failure(let error):
print("\(error)")
}
}
```There is multiple level of logs:
- none: Does not show any logs
- simple: Only logs the url
- verbose: Logs all the content of the HTTP request such as headers, body, query, ...## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md) for more details!
This project adheres to the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md).
By participating, you are expected to uphold this code. Please report
unacceptable behavior to [[email protected]](mailto:[email protected]).## License
Alamofire+Logging is licensed under the [BSD 3-Clause license](LICENSE).