示例:

#define log_dbg(format,args...) \
        printf("[DBG] [%s: %s() line:%d]: "format ,__FILE__,__func__,__LINE__,##args)

 

注:__FILE__,__func__,__LINE__ 为编译器内置宏,灵活使用可以巧妙地帮我们输出非常有用的调试信息。

相关文章:

  • 2021-07-21
  • 2021-11-26
  • 2022-12-23
  • 2022-12-23
  • 2021-04-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-06
  • 2022-01-05
  • 2021-11-06
  • 2021-08-14
  • 2022-03-01
  • 2022-12-23
相关资源
相似解决方案