Chinaunix首页 | 论坛 | 博客
  • 博客访问: 533732
  • 博文数量: 78
  • 博客积分: 1913
  • 博客等级: 上尉
  • 技术积分: 829
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-14 21:29
文章分类

全部博文(78)

文章存档

2011年(27)

2010年(26)

2009年(20)

2008年(5)

我的朋友

分类: BSD

2011-04-07 17:44:39

  1. #define ZYDEBUG (0 == 0)

  2. #if ZYDEBUG
  3. #define ZYLOG(format,...) NSLog(@"[%s][%s][%d]" format, __FILE__, __func__, __LINE__, ##__VA_ARGS__)
  4. #else
  5. #define ZYLOG(format,...) do{}while(0)
  6. #endif
更新如下:
  1. /* 0 is NSLog(); <0 no output; >0 verbose output */
  2. #define ZYDEBUGLEVEL 0

  3. #if (ZYDEBUGLEVEL > 1)
  4.     #define ZYLog(formatString,...) NSLog(@"\n\tFile:%@, \n\tFunction:%s, \n\tLine:%d>>" formatString, [[NSString stringWithUTF8String:__FILE__] lastPathComponent] , __func__, __LINE__, ##__VA_ARGS__)
  5. #elif (ZYDEBUGLEVEL == 0)
  6.     #define ZYLog(formatString, ...) NSLog(formatString, ##__VA_ARGS__)
  7. #else
  8.     #define ZYLog(formatString,...) do{}while(0)
  9. #endif
阅读(1390) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~