From 67ed711088b4ddafbdfc470618ed427082e1a106 Mon Sep 17 00:00:00 2001 From: yangwei Date: Wed, 31 May 2023 12:06:19 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A6=84=20refactor(MESA=5FHANDLE=5FRUNTIME?= =?UTF-8?q?=5FLOG):=20=E6=8C=89C99=E6=A0=87=E5=87=86=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E5=AE=8F=E5=B1=95=E5=BC=80=EF=BC=8C=E5=B1=95=E5=BC=80=E5=89=8D?= =?UTF-8?q?=E5=88=A4=E6=96=ADlevel=E6=98=AF=E5=90=A6enable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/MESA_handle_logger.h | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/inc/MESA_handle_logger.h b/inc/MESA_handle_logger.h index 49cee4a..54aa9ba 100644 --- a/inc/MESA_handle_logger.h +++ b/inc/MESA_handle_logger.h @@ -23,21 +23,15 @@ int MESA_handle_runtime_log_creation(const char *conf_path); int MESA_handle_runtime_log_reconstruction(const char *conf_path); void MESA_handle_runtime_log_destruction(); -#define MESA_HANDLE_RUNTIME_LOG(handle, lv, mod, fmt, args...) \ - MESA_handle_runtime_log((handle), (lv), (mod), "file %s, line %d, " fmt, \ - __FILE__, __LINE__, ##args) - - - -/* -#define MESA_HANDLE_RUNTIME_LOG_EXPAND(handle, level, module, fmt, ...) \ - { \ - if (MESA_handle_runtime_log_level_enabled(handle, level)) \ - { \ - MESA_handle_runtime_log(handle, level, module, fmt, __VA_ARGS__); \ - } \ - } -*/ +#define MESA_HANDLE_RUNTIME_LOG(handle, level, module, format, ...) \ +do \ +{ \ + 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__); \ + } \ +} while (0) int MESA_handle_runtime_log_level_enabled(void *handle, const int level); /*