NSLog的宏定义改进版本
2014-02-22 13:31
204 查看
//A better version of NSLog
#define NSLog(format, ...) do { \
fprintf(stderr, "<%s : %d> %s\n", \
[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], \
__LINE__, __func__); \
(NSLog)((format), ##__VA_ARGS__); \
fprintf(stderr, "-------\n"); \
} while (0)
摘自宏定义的黑魔法 - 宏菜鸟起飞手册
#define NSLog(format, ...) do { \
fprintf(stderr, "<%s : %d> %s\n", \
[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], \
__LINE__, __func__); \
(NSLog)((format), ##__VA_ARGS__); \
fprintf(stderr, "-------\n"); \
} while (0)
摘自宏定义的黑魔法 - 宏菜鸟起飞手册
相关文章推荐
- MongoDB 模糊查询
- usaco 2002 月赛 Fiber Communications 题解
- C++友元
- 五险一金
- 一步步学习ASP.NET MVC3 (13)——HTML辅助方法
- bzoj 1218题解
- Ubuntu Linux下设置IP的配置命令
- NOR flash vs NAND flash
- linux时钟处理机制(一)
- unity自带寻路Navmesh入门教程(一)
- 关于如何将多个Cpp文件关联起来
- /lib和/usr/lib、/usr/local/lib区别
- 博客迁移
- linux学习笔记一:linux的基础知识
- Windows Phone App Studio发布重要更新-支持Windows 8.1 源代码生成
- Single Number
- php的SAPI,CLI SAPI,CGI SAPI
- ibatis学习之代码生成器(一)
- samba共享文件夹设置
- poj 2299 Ultra-QuickSort 题解