#ifdef DEBUG
#define DKLog(format, ...) printf("class: <%p %s:(%d) > method: %s \n%s\n", self, [[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, __PRETTY_FUNCTION__, [[NSString stringWithFormat:(format), ##__VA_ARGS__] UTF8String] )
#define PrintJson(response,desc) NSData *tempData = [NSJSONSerialization dataWithJSONObject:response options:0 error:nil];\
NSString *tempStr = [[NSString alloc] initWithData:tempData encoding:NSUTF8StringEncoding];\
DKLog(@"\n\n========== start %@返回 的數(shù)據(jù)Json串 ==========\n%@ \n========== end ==========\n\n",desc, tempStr);
#else
#define NSLog(format, ...)
#endif
有時候返回的數(shù)據(jù)用NSLog打印會出現(xiàn)打印不全的問題,這里可以使用DKLog解決脚线,打印response可以使用PrintJson解決英遭。以上兩種需要在debug模式下才能使用器联。