🦄 refactor(MESA_HANDLE_RUNTIME_LOG): 按C99标准进行宏展开,展开前判断level是否enable
This commit is contained in:
@@ -23,21 +23,15 @@ int MESA_handle_runtime_log_creation(const char *conf_path);
|
|||||||
int MESA_handle_runtime_log_reconstruction(const char *conf_path);
|
int MESA_handle_runtime_log_reconstruction(const char *conf_path);
|
||||||
void MESA_handle_runtime_log_destruction();
|
void MESA_handle_runtime_log_destruction();
|
||||||
|
|
||||||
#define MESA_HANDLE_RUNTIME_LOG(handle, lv, mod, fmt, args...) \
|
#define MESA_HANDLE_RUNTIME_LOG(handle, level, module, format, ...) \
|
||||||
MESA_handle_runtime_log((handle), (lv), (mod), "file %s, line %d, " fmt, \
|
do \
|
||||||
__FILE__, __LINE__, ##args)
|
{ \
|
||||||
|
if (MESA_handle_runtime_log_level_enabled(handle, level)) \
|
||||||
|
{ \
|
||||||
|
MESA_handle_runtime_log(handle, level, module, "file %s, line %d, " format, \
|
||||||
/*
|
__FILE__, __LINE__, ##__VA_ARGS__); \
|
||||||
#define MESA_HANDLE_RUNTIME_LOG_EXPAND(handle, level, module, fmt, ...) \
|
} \
|
||||||
{ \
|
} while (0)
|
||||||
if (MESA_handle_runtime_log_level_enabled(handle, level)) \
|
|
||||||
{ \
|
|
||||||
MESA_handle_runtime_log(handle, level, module, fmt, __VA_ARGS__); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
int MESA_handle_runtime_log_level_enabled(void *handle, const int level);
|
int MESA_handle_runtime_log_level_enabled(void *handle, const int level);
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user