From fa062996372b6f19bfceaeada5d1d59de2d82507 Mon Sep 17 00:00:00 2001 From: HubretXie Date: Tue, 4 Dec 2018 09:09:58 +0800 Subject: [PATCH 1/2] Update ulog_def.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加log_hex --- components/utilities/ulog/ulog_def.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/utilities/ulog/ulog_def.h b/components/utilities/ulog/ulog_def.h index 8df3dd2087..e7c033f71c 100644 --- a/components/utilities/ulog/ulog_def.h +++ b/components/utilities/ulog/ulog_def.h @@ -94,6 +94,12 @@ extern "C" { #define ulog_e(TAG, ...) #endif /* (LOG_LVL >= LOG_LVL_ERROR) && (ULOG_OUTPUT_LVL >= LOG_LVL_ERROR) */ +#if (LOG_LVL >= LOG_LVL_DBG) && (ULOG_OUTPUT_LVL >= LOG_LVL_DBG) + #define ulog_hex(TAG, width, buf, size) ulog_hexdump(TAG, width, buf, size) +#else + #define ulog_hex(TAG, width, buf, size) +#endif /* (LOG_LVL >= LOG_LVL_DBG) && (ULOG_OUTPUT_LVL >= LOG_LVL_DBG) */ + /* assert for developer. */ #ifdef ULOG_ASSERT_ENABLE #define ULOG_ASSERT(EXPR) \ @@ -132,6 +138,7 @@ extern "C" { #define log_d LOG_D #define log_v LOG_D #define log_raw LOG_RAW +#define log_hex LOG_HEX #define ELOG_LVL_ASSERT LOG_LVL_ASSERT #define ELOG_LVL_ERROR LOG_LVL_ERROR #define ELOG_LVL_WARN LOG_LVL_WARNING From 81cd4d4f4b1f1cb35d562ab1b1998471bcc42cbb Mon Sep 17 00:00:00 2001 From: HubretXie Date: Tue, 4 Dec 2018 09:10:52 +0800 Subject: [PATCH 2/2] Update ulog.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加LOG_HEX --- components/utilities/ulog/ulog.h | 1 + 1 file changed, 1 insertion(+) diff --git a/components/utilities/ulog/ulog.h b/components/utilities/ulog/ulog.h index 792c098568..c78d72eda5 100644 --- a/components/utilities/ulog/ulog.h +++ b/components/utilities/ulog/ulog.h @@ -45,6 +45,7 @@ void ulog_deinit(void); #define LOG_I(...) ulog_i(LOG_TAG, __VA_ARGS__) #define LOG_D(...) ulog_d(LOG_TAG, __VA_ARGS__) #define LOG_RAW(...) ulog_raw(__VA_ARGS__) +#define LOG_HEX(name, width, buf, size) ulog_hex(name, width, buf, size) /* * backend register and unregister