forked from depoon/NetworkInterceptor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
62 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Change Log | ||
All notable changes to this project will be documented in this file. [Semver](http://semver.org/) is used for versioning. | ||
|
||
- `0.1.x` Releases - [0.1.0](#010) | ||
|
||
--- | ||
|
||
## [0.1.0](https://github.com/hkellaway/Nog/releases/tag/0.1.0) | ||
Released on 2021-03-28. | ||
|
||
#### Added | ||
- Logging network request URLs to console | ||
- Ability to turn logging on/off | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,50 @@ | ||
# Nog | ||
# Nog: A Delicious Network Request Logger :coffee: | ||
|
||
A delicious network request logger in Swift :coffee: | ||
[![Swift](https://img.shields.io/badge/Swift-5.3-orange.svg)](https://swift.org/about/) | ||
[![SPM](https://img.shields.io/badge/SPM-compatible-brightgreen.svg)](https://swift.org/package-manager/) | ||
[![License](https://img.shields.io/badge/License-MIT-lightgray.svg)](https://raw.githubusercontent.com/hkellaway/Nog/master/LICENSE) | ||
|
||
:construction: Currently under construction :construction: | ||
## Usage | ||
|
||
> :bulb: Nog assumes usage of `URLSessionConfiguration.default`. | ||
To start logging network requests, create an instance of `NetworkLogger` and call `start`: | ||
|
||
``` swift | ||
let myNetworkLogger = NetworkLogger() | ||
myNetworkLogger.start() | ||
``` | ||
|
||
Nog will print request URLs to the console: | ||
|
||
``` | ||
[Nog] Request #1: URL => https://github.com/ | ||
``` | ||
|
||
To stop logging, simply call `stop`: | ||
|
||
``` swift | ||
myNetworkLogger.stop() | ||
``` | ||
|
||
To check whether logging is currently on, call `isLogging`: | ||
|
||
``` swift | ||
myNetworkLogger.isLogging | ||
``` | ||
|
||
See the [Demo](/Demo) project for sample usage. | ||
|
||
## Installation | ||
|
||
### Installation with Swift Package Manager | ||
|
||
See [Adding Package Dependencies to Your App](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app). Search for `Nog` with *Owner* `hkellaway`. Point to the desired version or the `master` branch for the latest. | ||
|
||
## Credits | ||
|
||
Nog was created by [Harlan Kellaway](http://hkellaway.github.io) forked originally from [depoon/NetworkInterceptor](https://github.com/depoon/NetworkInterceptor/releases/tag/0.0.8). :heart: :green_heart: | ||
|
||
## License | ||
|
||
Nog is available under the MIT license. See the [LICENSE](https://raw.githubusercontent.com/hkellaway/Nog/master/LICENSE) file for more info. |