Skip to content

Commit 99ea4ef

Browse files
committed
LOG: Add BT_LOGV to print verbose log.
bug: v/78468 Signed-off-by: YuhengLi <[email protected]>
1 parent 6c9dc55 commit 99ea4ef

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ config BLUETOOTH_SERVICE_LOG_LEVEL
828828
default 7
829829
depends on BLUETOOTH_SERVICE
830830
help
831-
Set BT Service log level <0~7>
831+
Set BT Service log level <0~8>
832832
endif #BLUETOOTH_LOG
833833

834834
endmenu #Debug

service/utils/log.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ enum bt_log_level_ {
4242
BT_LOG_LEVEL_WARNING = LOG_WARNING,
4343
BT_LOG_LEVEL_INFO = LOG_INFO,
4444
BT_LOG_LEVEL_DEBUG = LOG_DEBUG,
45+
BT_LOG_LEVEL_VERBOSE,
4546
};
4647

4748
#ifndef CONFIG_BLUETOOTH_SERVICE_LOG_LEVEL
@@ -51,6 +52,7 @@ enum bt_log_level_ {
5152
#define BT_LOGW(fmt, args...)
5253
#define BT_LOGI(fmt, args...)
5354
#define BT_LOGD(fmt, args...)
55+
#define BT_LOGV(fmt, args...)
5456
#else
5557
extern bool bt_log_print_check(uint8_t level);
5658

@@ -81,6 +83,15 @@ extern bool bt_log_print_check(uint8_t level);
8183
if (bt_log_print_check(BT_LOG_LEVEL_DEBUG)) \
8284
BT_LOG(LOG_ID_FRAMEWORK, BT_LOG_LEVEL_DEBUG, fmt, ##__VA_ARGS__); \
8385
} while (0);
86+
#if CONFIG_BLUETOOTH_SERVICE_LOG_LEVEL < 8
87+
#define BT_LOGV(fmt, args...)
88+
#else
89+
#define BT_LOGV(fmt, ...) \
90+
do { \
91+
if (bt_log_print_check(BT_LOG_LEVEL_VERBOSE)) \
92+
BT_LOG(LOG_ID_FRAMEWORK, BT_LOG_LEVEL_DEBUG, fmt, ##__VA_ARGS__); \
93+
} while (0);
94+
#endif
8495
#endif
8596

8697
#define BT_ADDR_LOG(fmt, _addr, ...) \

0 commit comments

Comments
 (0)