#ifndef _LOG_H
#define _LOG_H
#ifdef __cpluscplus
extern "C"
{
#endif
#include <stdio.h>
#include <MESA/MESA_handle_logger.h>
extern void *g_default_logger;
int LOG_INIT(const char *profile);
void LOG_CLOSE(void);
void LOG_RELOAD(void);
#define LOG_DEBUG(format, ...) \
do \
{ \
if (g_default_logger) \
MESA_handle_runtime_log(g_default_logger, RLOG_LV_DEBUG, __FUNCTION__, format, ##__VA_ARGS__); \
else \
fprintf(stdout, "DEBUG " format "\n", ##__VA_ARGS__); \
} while (0)
#define LOG_INFO(format, ...) \
MESA_handle_runtime_log(g_default_logger, RLOG_LV_INFO, __FUNCTION__, format, ##__VA_ARGS__); \
fprintf(stdout, "INFO " format "\n", ##__VA_ARGS__); \
#define LOG_ERROR(format, ...) \
MESA_handle_runtime_log(g_default_logger, RLOG_LV_FATAL, __FUNCTION__, format, ##__VA_ARGS__); \
fprintf(stderr, "ERROR " format "\n", ##__VA_ARGS__); \
}