Bluetooth: Switch from SYS_LOG to logger-based logging
Initial conversion to use syslog instead of logger. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
5bd6bc4bed
commit
343c53e841
60 changed files with 93 additions and 25 deletions
|
@ -54,21 +54,27 @@ __printf_like(2, 3) void bt_log(int prio, const char *fmt, ...);
|
|||
|
||||
#elif defined(CONFIG_BT_DEBUG_LOG)
|
||||
|
||||
#if !defined(SYS_LOG_DOMAIN)
|
||||
#define SYS_LOG_DOMAIN "bt"
|
||||
#if BT_DBG_ENABLED
|
||||
#define LOG_LEVEL LOG_LEVEL_DBG
|
||||
#else
|
||||
#define LOG_LEVEL CONFIG_LOG_DEFAULT_LEVEL
|
||||
#endif
|
||||
#define SYS_LOG_LEVEL SYS_LOG_LEVEL_DEBUG
|
||||
#include <logging/sys_log.h>
|
||||
|
||||
#define BT_DBG(fmt, ...) \
|
||||
if (BT_DBG_ENABLED) { \
|
||||
SYS_LOG_DBG("(%p) " fmt, k_current_get(), \
|
||||
##__VA_ARGS__); \
|
||||
}
|
||||
#include <logging/log.h>
|
||||
|
||||
#define BT_ERR(fmt, ...) SYS_LOG_ERR(fmt, ##__VA_ARGS__)
|
||||
#define BT_WARN(fmt, ...) SYS_LOG_WRN(fmt, ##__VA_ARGS__)
|
||||
#define BT_INFO(fmt, ...) SYS_LOG_INF(fmt, ##__VA_ARGS__)
|
||||
LOG_MODULE_REGISTER(LOG_MODULE_NAME);
|
||||
|
||||
#if IS_ENABLED(CONFIG_LOG_FUNCTION_NAME)
|
||||
#define BT_DBG(fmt, ...) LOG_DBG(fmt, ##__VA_ARGS__)
|
||||
#define BT_ERR(fmt, ...) LOG_ERR(fmt, ##__VA_ARGS__)
|
||||
#define BT_WARN(fmt, ...) LOG_WRN(fmt, ##__VA_ARGS__)
|
||||
#else
|
||||
#define BT_DBG(fmt, ...) LOG_DBG("%s: " fmt, __func__, ##__VA_ARGS__)
|
||||
#define BT_ERR(fmt, ...) LOG_ERR("%s: " fmt, __func__, ##__VA_ARGS__)
|
||||
#define BT_WARN(fmt, ...) LOG_WRN("%s: " fmt, __func__, ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#define BT_INFO(fmt, ...) LOG_INF(fmt, ##__VA_ARGS__)
|
||||
|
||||
/* Enabling debug increases stack size requirement considerably */
|
||||
#define BT_STACK_DEBUG_EXTRA 300
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue