Latest 1.0.0
Homepage https://github.com/jprothwell/AFHTTPSessionManagerLogger
License MIT
Platforms ios 8.0, requires ARC
Dependencies AFNetworking
Authors

Logger for AFNetworking 3.x. Inspire by AFHTTPClientLogger.

AFHTTPSessionManagerLogger is a request logging extension for AFNetworking. It

provides configurable HTTP request logging features on a per AFHTTPSessionManager
instance basis.

It is conceptually similar to [AFHTTPRequestOperationLogger][], which works
globally across all AFHTTPSessionManager instances.

AFHTTPSessionManagerLogger supports logging via CocoaLumberjack and will use its logging methods over NSLog if it’s available.

Usage

The logger is accessed via the logger property of an AFHTTPSessionManager object
instance (simply named manager in the examples below). It must be explicitly
enabled:

manager.logger.enabled = YES;

You can configure the log level to control the output’s verbosity:

manager.logger.level = AFHTTPSessionManagerLogLevelDebug;

You can also customize the output by supplying your own format blocks:

[manager.logger setRequestStartFormatBlock:^NSString *(NSURLSessionTask *task, AFHTTPSessionManagerLogLevel level) {
    if (level > AFHTTPSessionManagerLogLevelInfo) {
        return nil;
    }

    return [NSString stringWithFormat:@"%@ %@", [task.originRequest HTTPMethod], [[task.originRequest URL] absoluteString]];
}];

License

AFHTTPSessionManagerLogger is available under the MIT license. See the included
LICENSE file for details.

Contact

Latest podspec

{
    "name": "AFHTTPSessionManagerLogger",
    "version": "1.0.0",
    "license": "MIT",
    "authors": {
        "Kim Huang": "[email protected]"
    },
    "summary": "AFNetworking Extension for request logging.",
    "homepage": "https://github.com/jprothwell/AFHTTPSessionManagerLogger",
    "source": {
        "git": "https://github.com/jprothwell/AFHTTPSessionManagerLogger.git",
        "tag": "1.0.0"
    },
    "requires_arc": true,
    "dependencies": {
        "AFNetworking": [
            ">= 3.0"
        ]
    },
    "source_files": "AFHTTPSessionManagerLogger.{h,m}",
    "platforms": {
        "ios": "8.0"
    }
}

Pin It on Pinterest

Share This