| 12345678910111213141516171819202122232425262728293031323334 |
- #ifndef _commLOG_H_
- #define _commLOG_H_
-
- #include <stdio.h>
- #include <string.h>
- #include <unistd.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <stdarg.h>
- #include <time.h>
- #include <assert.h>
- #include <errno.h>
- #define LOG_SIZE_MAX 4096 //16777216 //1024*1024*16=16M
- #define LOG_LINE_MAX 120 //1000
- #define LOG_FILE_PATH "/root/door-ctrl/log-door-ctrl" //日志文件路径
- #define LOG_PARAMS LOG_FILE_PATH,__FILE__,__func__,__LINE__ //日志文件路径 调用函数所在文件 调用函数名 调用debugInfo时所在行号
- //显示调用debugInfo接口的函数所在的文件名、函数名、行号
- //调用举例: debuInfo(LOG_PARAMS, “some string %s, some int %d and so on", "hello log", 101);
- #if 1
- int debugInfo(char *pLogPath, char *pFile, const char *pFuncName, int iLineNumb, char *fmt, ...);
- #define DBGLog(fmt, args...) debugInfo(LOG_PARAMS, fmt, ##args)
- #else
- #define DBGLog(fmt, args...) do{}while(0)
- #endif
-
- #define LOG_VS_ERR 0
- #define LOG_VS_OK 1
- #define LOG_STR_LEN_1024 1024
- #define LOG_STR_LEN_512 512
- #endif
|