首页 > 技术文章 > 自定义的打印语句NSLog在控制台输出不完整的完美解决

110-913-1025 2018-05-30 18:03 原文

// 打印日志  debug
#ifdef DEBUG // 调试状态, 打开LOG功能 
#define APPLog( s, ... ) printf("class: <%p %s:(%d) > method: %s \n%s\n", self, [[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, __PRETTY_FUNCTION__, [[NSString stringWithFormat:(s), ##__VA_ARGS__] UTF8String] )

#else // 发布状态, 关闭LOG功能 
#define APPLog(...)

#endif

 而且还进行了utf8的解码,可以直接看到后台传过来的汉字。

推荐阅读