只在debug模式打印log

#ifndef __OPTIMIZE__
#define NSLog(fmt, ...) NSLog((@"\n╠ [文件名:%@]\n" "[函数名:%s" " +%d] \n" fmt" ╣\n\n"), [[[NSString stringWithCString:__FILE__ encoding:NSUTF8StringEncoding] componentsSeparatedByString:@"/"] lastObject], __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
#define NSLog(...) {}
#endif

使用方法:

NSLog(@"要打印的内容");//覆盖了系统的NSLog

你可能感兴趣的:(只在debug模式打印log)