重写NSLog,Debug模式下打印日志和当前行数
2016-03-08 17:24 甘雨路 阅读(438) 评论(0) 收藏 举报在pch文件中加入以下命令,NSLog在真机测试中就不会打印了
//重写NSLog,Debug模式下打印日志和当前行数
#if DEBUG
#define NSLog(FORMAT, ...) fprintf(stderr,"\nfunction:%s line:%d content:%s\n", __FUNCTION__, __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
#else
#define NSLog(FORMAT, ...) nil
#endif
浙公网安备 33010602011771号