码迷,mamicode.com
首页 > Web开发 > 详细

AFNetworking/AFNetworkActivityLogger

时间:2015-11-03 17:50:04      阅读:851      评论:0      收藏:0      [点我收藏+]

标签:

 

git账号又忘了,额。。。

发现项目中有很多可以学习的地方。加油

https://github.com/AFNetworking/AFNetworkActivityLogger

Usage

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

[[AFNetworkActivityLogger sharedLogger] startLogging];

Now all AFURLConnectionOperation and NSURLSessionTask objects created by an AFURLSessionManager 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:

[[AFNetworkActivityLogger sharedLogger] setLevel:AFLoggerLevelError];

AFNetworking/AFNetworkActivityLogger

标签:

原文地址:http://www.cnblogs.com/yintingting/p/4933476.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!