升级Xcode 8
之后运行项目,会打印一些烦人的Log
信息,解决的办法就是OS_ACTIVITY_MODE = disable
,如下:
系统的NSLog()
已经不好使了,这个只能在iOS 9
之前的系统管用,如果想要在iOS 10
系统的手机也能打印日志,我们需要用到printf()
自定义Log
-
#ifdef DEBUG
-
#define LRString [NSString stringWithFormat:@"%s",__FILE__].lastPathComponent
-
#define LRLog(...) NSLog(@"%@ 第%d行 \n%@\n\n",LRString,__LINE__,[NSString stringWithFormat:__VA_ARGS__])
-
-
#else
-
#define LRLog(...)
-
#endif