5 #ifndef DP_UTIL_DEBUG_H_ 6 #define DP_UTIL_DEBUG_H_ 55 #define DEBUG_PRINT(...) 65 #define DPDEBUG_INIT timelog_g=dp_timelog_init(",", 2048, 8192, 0); dp_timelog_print(timelog_g,"init\n"); 67 #define DPDEBUG_INIT_THREADSAFE timelog_g=dp_timelog_init(",", 2048, 1, 1); dp_timelog_print(timelog_g,"init\n"); 69 #define DEBUG_ERRPRINT(...) DEBUG_ERRPRINT_(__VA_ARGS__, "") 70 #define DEBUG_ERRPRINT_(fmt, ...) \ 71 dp_timelog_print(timelog_g, "[%s(%s:%d)thread:%x]: "fmt"%s", __FUNCTION__,__FILE__,__LINE__,(unsigned int)pthread_self(), __VA_ARGS__) 73 #define DPDEBUG_EXIT dp_timelog_print(timelog_g,"exit\n");dp_timelog_exit(timelog_g);timelog_g=NULL; 78 #define DEBUG_PRINT(...) DEBUG_ERRPRINT_(__VA_ARGS__, "") 84 #define DPDEBUG_INIT_THREDSAFE 85 #define DEBUG_ERRPRINT(...)
int dp_timelog_print(DPTimeLog handle, const char *format,...)
Store log.
unsigned long maxstoresize
numnber of current stored log
void dp_timelog_exit(DPTimeLog handle)
Exit stored log, and show stored log.
DPTimeLog dp_timelog_init(const char *delimiter, size_t maxloglen, unsigned long maxstoresize, int is_threadsafe)
Init store log.
struct dp_timelog_t * DPTimeLog
storaged log data management structure
DPTimeLog timelog_g
global timelog handle to show debug log