NSLog宏定义,发布后默认不打印
2015-07-03 17:19
204 查看
设置如图: DEBUG=1
头文件写如下宏:
#ifdef DEBUG
#define DLog( s, ... ) NSLog( @"<%p %@:(%d)> %@", self, [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] )
#else
#define DLog( s, ... )
#endif
即可
头文件写如下宏:
#ifdef DEBUG
#define DLog( s, ... ) NSLog( @"<%p %@:(%d)> %@", self, [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] )
#else
#define DLog( s, ... )
#endif
即可
相关文章推荐
- 设计模式-组合模式
- Win10预览版10162安装及激活图文详细教程
- Win32 Application和Win32 Console Application的区别
- 一个C语言写的2048游戏
- android 仿微信6.2右滑返回
- PeopleSoft 数据库体系结构
- Cross compile perl
- Masonry 当需要把某个控件进行隐藏的时候有警告的解决方案
- 纠结的问题
- iOS--Xib文件中定义的控件修改frame问题
- Destoon标签使用技巧十则
- 关于android底层系统的学习
- BLE 广播时间设置
- 温习下设计模式
- 我的前端面试题
- UVa Problem 704 Colour Hash (色彩缤纷游戏)
- wpa_supplicant
- Java和JavaScript中使用Json方法大全
- WINFrom Excal 数据导入数据库
- IFrame 获取内容