From a9a722994e2f739f1763bb7611b89a7bb9d3a0da Mon Sep 17 00:00:00 2001 From: liuyifei Date: Wed, 30 Jul 2025 09:57:26 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E5=A2=9Ehilog=20comm=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liuyifei --- .../native/innerkits/include/hilog/log_c.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/interfaces/native/innerkits/include/hilog/log_c.h b/interfaces/native/innerkits/include/hilog/log_c.h index 8c7b5c0..af40084 100644 --- a/interfaces/native/innerkits/include/hilog/log_c.h +++ b/interfaces/native/innerkits/include/hilog/log_c.h @@ -114,6 +114,25 @@ int HiLogPrint(LogType type, LogLevel level, unsigned int domain, const char *ta */ #define HILOG_IMPL(type, level, domain, tag, ...) HiLogPrint(type, level, domain, tag, ##__VA_ARGS__) +/** + * @brief Hilog C interface of different log level in release version + * + * @param type enum:LogType + */ +#define HILOG_COMM_INFO(fmt, ...) ((void)HILOG_COMM_IMPL(LOG_INFO, LOG_DOMAIN, LOG_TAG, fmt, ##__VA_ARGS__)) +#define HILOG_COMM_WARN(fmt, ...) ((void)HILOG_COMM_IMPL(LOG_WARN, LOG_DOMAIN, LOG_TAG, fmt, ##__VA_ARGS__)) +#define HILOG_COMM_ERROR(fmt, ...) ((void)HILOG_COMM_IMPL(LOG_ERROR, LOG_DOMAIN, LOG_TAG, fmt, ##__VA_ARGS__)) +#define HILOG_COMM_FATAL(fmt, ...) ((void)HILOG_COMM_IMPL(LOG_FATAL, LOG_DOMAIN, LOG_TAG, fmt, ##__VA_ARGS__)) + +/** + * @brief Hilog C interface implementation in release version + * + * @param level enum:LogLevel + * @param domain macro:LOG_DOMAIN + * @param tag macro:LOG_TAG + */ +#define HILOG_COMM_IMPL(level, domain, tag, ...) HiLogPrint(LOG_CORE, level, domain, tag, ##__VA_ARGS__) + /** * @brief Check whether log of a specified domain, tag and level can be printed. * -- Gitee From 2b2385f265378786875a1cce5196881fe2d2bb09 Mon Sep 17 00:00:00 2001 From: liuyifei Date: Thu, 31 Jul 2025 02:31:40 +0000 Subject: [PATCH 2/2] update interfaces/native/innerkits/include/hilog/log_c.h. Signed-off-by: liuyifei --- interfaces/native/innerkits/include/hilog/log_c.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interfaces/native/innerkits/include/hilog/log_c.h b/interfaces/native/innerkits/include/hilog/log_c.h index af40084..a1982af 100644 --- a/interfaces/native/innerkits/include/hilog/log_c.h +++ b/interfaces/native/innerkits/include/hilog/log_c.h @@ -117,7 +117,7 @@ int HiLogPrint(LogType type, LogLevel level, unsigned int domain, const char *ta /** * @brief Hilog C interface of different log level in release version * - * @param type enum:LogType + * @param fmt:format string */ #define HILOG_COMM_INFO(fmt, ...) ((void)HILOG_COMM_IMPL(LOG_INFO, LOG_DOMAIN, LOG_TAG, fmt, ##__VA_ARGS__)) #define HILOG_COMM_WARN(fmt, ...) ((void)HILOG_COMM_IMPL(LOG_WARN, LOG_DOMAIN, LOG_TAG, fmt, ##__VA_ARGS__)) -- Gitee