AFHTTPRequestOperationLogger 1.0.0

AFHTTPRequestOperationLogger 1.0.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Mar 2015

Maintained by Mattt, Kevin Harwood.


Downloads

Total167,652
Week0
Month0

Installs

Apps1,009
Test Targets110
Watch Apps4
powered by Segment

GitHub

Stars219
Watchers12
Forks57
Issues0
Contributors6
Pull Requests1

Code

Files2
LOCLines of Code 106


  • By
  • Mattt Thompson

AFHTTPRequestOperationLogger is an extension for AFNetworking that logs HTTP requests as they are sent and received.

AFHTTPRequestOperationLogger listens for AFNetworkingOperationDidStartNotification and AFNetworkingOperationDidFinishNotification notifications, which are posted by AFNetworking as request operations are started and finish. For further customization of logging output, users are encouraged to implement desired functionality by listening for these notifications.

Usage

Add the following code to AppDelegate.m -application:didFinishLaunchingWithOptions::

[[AFHTTPRequestOperationLogger sharedLogger] startLogging];

Now all AFHTTPRequestOperation 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

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:

[[AFHTTPRequestOperationLogger sharedLogger] setLevel:AFLoggerLevelError];

Contact

Mattt Thompson

License

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