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];
时间: 2024-10-14 00:37:01