1234567891011121314151617181920212223242526272829303132 |
- #ifndef INC_LOG_H_
- #define INC_LOG_H_
- #include <stdarg.h>
- #define DEBUG_ON 1
- #define _LOG_DEBUG
- #define _LOG_WARN
- #define _LOG_INFO
- #define LOG_LEN_MAX 256
- typedef enum LOG_LEVEL_U
- {
- LOG_NONE = 0,
- LOG_INFO,
- LOG_DEBUG,
- LOG_WARN,
- LOG_ERROR,
- LOG_MAX,
- }logLevel_t;
- void LogPrint(logLevel_t logLevel,const char *file, const char *func, const int line, char * fmt, ...);
- void log_init(void);
- int get_udp_sem(void);
- #define LOG_PRINT(logLevel, fmt, ...) if(DEBUG_ON){LogPrint(logLevel,__FILE__,__FUNCTION__, __LINE__, fmt, ##__VA_ARGS__);}
- #endif /* INC_LOG_H_ */
|