相关文章推荐
长情的啤酒  ·  Type 'string | ...·  1 年前    · 
细心的警车  ·  使用谷歌Colab ...·  2 年前    · 

正常NSLog打印容易被阶段,特别是转出json字符串打印的时候,使用以下方法可以达到完整打印日志的效果

#ifdef DEBUG
#define DDLog(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] )
#else
#define DDLog(format, ...)
#endif