记录:iOS开发关于Xcode 控制台打印服务器响应数据不全的问题

并非原创,简单加工

原文:
1.https://www.jianshu.com/p/d396deb01cf2
2.https://www.jianshu.com/p/001e0c310f5e

// 打印输出
#ifdef RELEASE
#define NSLog(format, ...)
#else
#define NSLog(FORMAT, ...) {\
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];\
[dateFormatter setDateStyle:NSDateFormatterMediumStyle];\
[dateFormatter setTimeStyle:NSDateFormatterShortStyle];\
NSTimeZone* timeZone = [NSTimeZone timeZoneWithName:@"Asia/Beijing"];\
[dateFormatter setTimeZone:timeZone];\
[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];\
NSString *str = [dateFormatter stringFromDate:[NSDate date]];\
fprintf(stderr,"【TIME:%s】【FILE:%s-- LINE:%d】FUNCTION:%s\n%s\n",[str UTF8String],[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__,__PRETTY_FUNCTION__,[[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);\
}
#endif

你可能感兴趣的:(记录:iOS开发关于Xcode 控制台打印服务器响应数据不全的问题)