TSG-16531 PacketAdapter适配容器环境,使用mrzcpd收包,通过RAW Socket注RST包
This commit is contained in:
73
common/include/log.h
Normal file
73
common/include/log.h
Normal file
@@ -0,0 +1,73 @@
|
||||
#ifndef _LOG_H
|
||||
#define _LOG_H
|
||||
|
||||
#ifdef __cpluscplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <MESA/MESA_handle_logger.h>
|
||||
|
||||
extern void *default_logger;
|
||||
|
||||
int LOG_INIT(const char *profile);
|
||||
void LOG_CLOSE(void);
|
||||
void LOG_RELOAD(void);
|
||||
|
||||
#define LOG_DEBUG(format, ...) \
|
||||
do \
|
||||
{ \
|
||||
if (default_logger == NULL) \
|
||||
{ \
|
||||
fprintf(stdout, "[DEBUG] " format "\n", ##__VA_ARGS__); \
|
||||
fflush(stdout); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
if (MESA_handle_runtime_log_level_enabled(default_logger, RLOG_LV_DEBUG)) \
|
||||
{ \
|
||||
MESA_handle_runtime_log(default_logger, RLOG_LV_DEBUG, __FUNCTION__, format, ##__VA_ARGS__); \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define LOG_INFO(format, ...) \
|
||||
do \
|
||||
{ \
|
||||
if (default_logger == NULL) \
|
||||
{ \
|
||||
fprintf(stdout, "[INFOR] " format "\n", ##__VA_ARGS__); \
|
||||
fflush(stdout); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
if (MESA_handle_runtime_log_level_enabled(default_logger, RLOG_LV_INFO)) \
|
||||
{ \
|
||||
MESA_handle_runtime_log(default_logger, RLOG_LV_INFO, __FUNCTION__, format, ##__VA_ARGS__); \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define LOG_ERROR(format, ...) \
|
||||
do \
|
||||
{ \
|
||||
if (default_logger == NULL) \
|
||||
{ \
|
||||
fprintf(stdout, "[ERROR] " format "\n", ##__VA_ARGS__); \
|
||||
fflush(stdout); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
if (MESA_handle_runtime_log_level_enabled(default_logger, RLOG_LV_FATAL)) \
|
||||
{ \
|
||||
MESA_handle_runtime_log(default_logger, RLOG_LV_FATAL, __FUNCTION__, format, ##__VA_ARGS__); \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#ifdef __cpluscplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user