#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 %@返回 的數據Json串 ==========\n%@ \n========== end ==========\n\n",desc, tempStr);
#else
#define NSLog(format, ...)
#endif
有時候返回的數據用NSLog打印會出現打印不全的問題,這里可以使用DKLog解決,打印response可以使用PrintJson解決。以上兩種需要在debug模式下才能使用。