nslog

时间:2023-03-08 18:01:34

今天有人问我怎么更好的使用nslog,打包的时候老注释

pch里加下面的代码就好了平时debug的时候打印,release后就不打印了

#ifdef DEBUG
#define NSLog(...) NSLog(__VA_ARGS__)
#define debugMethod() NSLog(@"%s", __func__)
#else
#define NSLog(...)
#define debugMethod()
#endif