when i debug samples in Zephyr, i can see log through UART when i use "printk" function.
but i find there has "BT_DBG" and "BT_WARN" in code. so what's its using? and where i can find the message it output?
Thanks for your help.
when i debug samples in Zephyr, i can see log through UART when i use "printk" function.
but i find there has "BT_DBG" and "BT_WARN" in code. so what's its using? and where i can find the message it output?
Thanks for your help.
You will find the logs in the serial output you have enabled (typically a UART instance), where you get your other log output. But you need to enable it. This is quite fine grained, and for instance if you want to enable logging for ATT, you need to set CONFIG_BT_DEBUG_ATT=y in you prj.conf.
You can search for the relevant Kconfig for the logs you are looking for, or if you have the implementation file open, you can look at that. For instance, if you are looking at nrf/subsys/bluetooth/controller/crypto.c and want the logs from there, you can take a look at line 18 where you see this:
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_KEYS)
And that tells you that to enable the debug logging in this file you need to add CONFIG_BT_DEBUG_KEYS=y to your prj.conf.
You will find the logs in the serial output you have enabled (typically a UART instance), where you get your other log output. But you need to enable it. This is quite fine grained, and for instance if you want to enable logging for ATT, you need to set CONFIG_BT_DEBUG_ATT=y in you prj.conf.
You can search for the relevant Kconfig for the logs you are looking for, or if you have the implementation file open, you can look at that. For instance, if you are looking at nrf/subsys/bluetooth/controller/crypto.c and want the logs from there, you can take a look at line 18 where you see this:
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_KEYS)
And that tells you that to enable the debug logging in this file you need to add CONFIG_BT_DEBUG_KEYS=y to your prj.conf.