acl/lib_acl/include/stdlib/acl_debug.h

57 lines
1.5 KiB
C
Raw Normal View History

2014-11-19 00:25:21 +08:00
#ifndef ACL_DEBUG_INCLUDE_H
#define ACL_DEBUG_INCLUDE_H
#include "acl_define.h"
#include "acl_msg.h"
#ifdef __cplusplus
extern "C" {
#endif
#define ACL_DEBUG_INTER_BASE 0 /**< <20><>С<EFBFBD><D0A1><EFBFBD>Ա<EFBFBD>ǩֵ */
#define ACL_DEBUG_WQ (ACL_DEBUG_INTER_BASE + 1) /**< ACL_WORKQ <20><><EFBFBD>Ա<EFBFBD>ǩ */
#define ACL_DEBUG_PROCTL (ACL_DEBUG_INTER_BASE + 2) /**< ACL_PROCTL <20><><EFBFBD>Ա<EFBFBD>ǩ */
#define ACL_DEBUG_THR_POOL (ACL_DEBUG_INTER_BASE + 3) /**< ACL_PTHREAD_POOL <20><><EFBFBD>Ա<EFBFBD>ǩ */
#define ACL_DEBUG_EVENT (ACL_DEBUG_INTER_BASE + 4) /**< ACL_EVENT <20><><EFBFBD>ȱ<EFBFBD>ǩ */
/**
* <EFBFBD><EFBFBD>־<EFBFBD><EFBFBD><EFBFBD>Ժ<EFBFBD><EFBFBD>ӿ<EFBFBD>
* @param SECTION {int} <EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD>ǩֵ
* @param LEVEL {int} <EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD>SECTION<EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD>ǩ<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>
*/
#define acl_debug(SECTION, LEVEL) \
!acl_do_debug((SECTION), (LEVEL)) ? (void) 0 : acl_msg_info
/**
* <EFBFBD>ͷ<EFBFBD><EFBFBD>ڲ<EFBFBD>һЩ<EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ
*/
ACL_API void acl_debug_end(void);
/**
* <EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD><EFBFBD>ýӿ<EFBFBD>
* @param ptr {const char*} <EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD>ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* <EFBFBD><EFBFBD>ʽ: 1:1, 2:10, 3:8... or 1:1; 2:10; 3:8...
*/
ACL_API void acl_debug_init(const char *ptr);
/**
* <EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD><EFBFBD>ýӿ<EFBFBD>
* @param ptr {const char*} <EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD>ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* <EFBFBD><EFBFBD>ʽ: 1:1, 2:10, 3:8... or 1:1; 2:10; 3:8...
* @param max_debug_level {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD>ǩֵ
*/
ACL_API void acl_debug_init2(const char *ptr, int max_debug_level);
/**
* <EFBFBD>жϸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǩ<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Χ<EFBFBD><EFBFBD>
* @param section {int} <EFBFBD><EFBFBD>ǩֵ
* @param level {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
*/
ACL_API int acl_do_debug(int section, int level);
#ifdef __cplusplus
}
#endif
#endif