阅读Sofia-SIP源码 - su模块 - su_debug.h/su_module_debug.h

现在知道去哪找介绍文档的文字了。本头文件的主要作用就是定义SU模块的调试宏。

/**@ingroup su_log
 * @file sofia-sip/su_debug.h
 * @brief SU debugging macros
 *
 * The logging levels and macros to use are defined as follows:
 *  - SU_DEBUG_0()  fatal errors, panic
 *  - SU_DEBUG_1()  critical errors, minimal progress at subsystem level
 *  - SU_DEBUG_2()  non-critical errors
 *  - SU_DEBUG_3()  warnings, progress messages
 *  - SU_DEBUG_5()  signaling protocol actions (incoming packets, etc.)
 *  - SU_DEBUG_7()  media protocol actions (incoming packets, etc.)
 *  - SU_DEBUG_9()  entering/exiting functions, very verbatim progress
 *
 * These macros are used to log with module-specific levels. The SU_LOG
 * macro is redefined with a pointer to a module-specific #su_log_t
 * structure, e.g., "iptsec_debug.h".
 *
 * @author Pekka Pessi <Pekka.Pessi@nokia.com>
 *
 * @date Created: Tue Feb  8 10:06:33 2000 ppessi
 *
 * @sa @ref debug_logs, su_llog(), su_vllog(), #su_log_t,
 */
从文字可以看出来,将会定义SU_DEBUG_0至SU_DEBUG_9这十个宏。还会用一个指向su_log_t结构体的变量重新再定义SU_LOG宏。所谓的重新定义SU_LOG宏的意思是,su模块是个基础模块,其他功能模块将使用它提供的基础服务来实现高层功能。例如,其他功能模块都会使用su模块提供的日志服务。因此其他功能模块一般都会再建立一个xxx_debug.h头文件,在这个头文件内会申明一个su_log_t结构体变量,然后再用这个新的su_log_t结构体变量重新定义SU_LOG宏。具体可参考iptsec_de
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值